Skip to content

Commit

Permalink
fix: replace sfdx-trust with plugin-trust
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Sep 8, 2021
1 parent b7df0ac commit 24c2a3c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Result {

const DEPENDENCIES: Dependency[] = [
{
name: 'sfdx-trust',
name: 'sfdx',
type: 'bin',
condition: (flags): boolean => !!flags.sign,
},
Expand Down
4 changes: 2 additions & 2 deletions src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class LernaRepo extends Repository {
public verifySignature(packageNames: string[]): void {
const packages = this.packages.filter((pkg) => packageNames.includes(pkg.name));
for (const pkg of packages) {
const cmd = `sfdx-trust plugins:trust:verify --npm ${
const cmd = `sfdx plugins:trust:verify --npm ${
pkg.name
}@${pkg.getNextVersion()} ${this.registry.getRegistryParameter()}`;
this.execCommand(cmd);
Expand Down Expand Up @@ -389,7 +389,7 @@ export class SinglePackageRepo extends Repository {
}

public verifySignature(): void {
const cmd = `sfdx-trust plugins:trust:verify --npm ${this.name}@${
const cmd = `sfdx plugins:trust:verify --npm ${this.name}@${
this.nextVersion
} ${this.registry.getRegistryParameter()}`;
this.execCommand(cmd);
Expand Down
10 changes: 5 additions & 5 deletions test/dependencies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import { verifyDependencies } from '../src/dependencies';

const $$ = testSetup();

describe('Depedencies', () => {
describe('Dependencies', () => {
it('should pass when all required env variables and bin scripts exist', () => {
$$.SANDBOX.stub(Env.prototype, 'getString').returns('foobar');
$$.SANDBOX.stub(shelljs, 'which').returns('foobar' as shelljs.ShellString);
const validation = verifyDependencies({ sign: true });
expect(validation.failures).to.equal(0);
expect(validation.results).to.deep.equal([
{ name: 'sfdx-trust', type: 'bin', passed: true },
{ name: 'sfdx', type: 'bin', passed: true },
{ name: 'AWS_ACCESS_KEY_ID', type: 'env', passed: true },
{ name: 'AWS_SECRET_ACCESS_KEY', type: 'env', passed: true },
{ name: 'NPM_TOKEN', type: 'env', passed: true },
Expand All @@ -34,7 +34,7 @@ describe('Depedencies', () => {
const validation = verifyDependencies({ sign: true });
expect(validation.failures).to.equal(3);
expect(validation.results).to.deep.equal([
{ name: 'sfdx-trust', type: 'bin', passed: true },
{ name: 'sfdx', type: 'bin', passed: true },
{
name: 'AWS_ACCESS_KEY_ID',
type: 'env',
Expand Down Expand Up @@ -64,8 +64,8 @@ describe('Depedencies', () => {
expect(validation.failures).to.equal(1);
expect(validation.results).to.deep.equal([
{
message: 'Install sfdx-trust',
name: 'sfdx-trust',
message: 'Install sfdx',
name: 'sfdx',
type: 'bin',
passed: false,
},
Expand Down
8 changes: 4 additions & 4 deletions test/repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ describe('SinglePackageRepo', () => {
execStub = stubMethod($$.SANDBOX, SinglePackageRepo.prototype, 'execCommand').returns('success');
});

it('should use sfdx-trust to verify that the package was signed', async () => {
it('should use plugin-trust to verify that the package was signed', async () => {
const repo = await SinglePackageRepo.create({ ux: uxStub });
repo.verifySignature();
expect(execStub.callCount).to.equal(1);
expect(execStub.firstCall.args[0]).to.include('sfdx-trust');
expect(execStub.firstCall.args[0]).to.include('sfdx plugins:trust:verify');
});
});

Expand Down Expand Up @@ -472,10 +472,10 @@ describe('LernaRepo', () => {
);
});

it('should use sfdx-trust to verify that the packages were signed', async () => {
it('should use plugin-trust to verify that the packages were signed', async () => {
const repo = await LernaRepo.create({ ux: uxStub });
repo.verifySignature([pkgName]);
expect(execStub.lastCall.args[0]).to.include('sfdx-trust');
expect(execStub.lastCall.args[0]).to.include('sfdx plugins:trust:verify');
});
});

Expand Down

0 comments on commit 24c2a3c

Please sign in to comment.