Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {
// --help
if ('help' == args[0]) {
args[0] = args[1];
args[1] = '--help';
}
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir
, link = readlink(f);
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link)
}
baseDir = dirname(link);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin)) {