How to use @zkochan/cmd-shim - 1 common examples

To help you get started, we’ve selected a few @zkochan/cmd-shim examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yarnpkg / yarn / src / fetchers / base-fetcher.js View on Github external
const binDest = `${this.dest}/.bin`;

          // Using any sort of absolute path here would prevent makePortableProxyScript from preserving symlinks when
          // calling the binary
          const src = path.resolve(this.dest, pkg.bin[binName]);

          if (await fs.exists(src)) {
            // We ensure that the target is executable
            await fs.chmod(src, 0o755);
          }

          await fs.mkdirp(binDest);
          if (process.platform === 'win32') {
            const unlockMutex = await lockMutex(src);
            try {
              await cmdShim.ifExists(src, `${binDest}/${binName}`, {createPwshFile: false});
            } finally {
              unlockMutex();
            }
          } else {
            await fs.symlink(src, `${binDest}/${binName}`);
          }
        }
      }

      await fs.writeFile(
        path.join(this.dest, constants.METADATA_FILENAME),
        JSON.stringify(
          {
            manifest: pkg,
            artifacts: [],
            remote: this.remote,

@zkochan/cmd-shim

Used in pnpm for command line application support

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Popular @zkochan/cmd-shim functions

Similar packages