semver.mts 547 B

1234567891011121314151617
  1. #!/usr/bin/env zx
  2. import 'zx/globals';
  3. import { cliArguments, getCargo, workingDirectory } from './setup/shared.mts';
  4. const [folder, ...args] = cliArguments();
  5. const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
  6. const isProcMacro = getCargo(folder).lib['proc-macro'] === true;
  7. if (isProcMacro) {
  8. echo(
  9. chalk.yellow.bold('[ SKIPPED ]'),
  10. 'Proc-macro found: only library targets with API surface that can be checked for semver.'
  11. );
  12. } else {
  13. await $`cargo semver-checks --manifest-path ${manifestPath} ${args}`;
  14. }