Skip to content

Commit

Permalink
Fixes check against windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis committed Sep 30, 2021
1 parent dac4134 commit 98036fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cli/commands/policies.js
Expand Up @@ -12,7 +12,7 @@ import {stringify} from '../../lockfile';
import {satisfiesWithPrereleases} from '../../util/semver.js';
import {NODE_BIN_PATH} from '../../constants';

const V2_NAMES = ['stable', 'berry', 'stable', 'canary', 'v2', '2'];
const V2_NAMES = ['berry', 'stable', 'canary', 'v2', '2'];

const isLocalFile = (version: string) => version.match(/^\.{0,2}[\\/]/) || path.isAbsolute(version);
const isV2Version = (version: string) => satisfiesWithPrereleases(version, '>=2.0.0');
Expand Down
2 changes: 1 addition & 1 deletion src/util/child.js
Expand Up @@ -18,7 +18,7 @@ let uid = 0;
export const exec = promisify(child.exec);

function validate(program: string, opts?: Object = {}) {
if (program.includes('/')) {
if (program.match(/[\\\/]/)) {
return;
}

Expand Down

0 comments on commit 98036fc

Please sign in to comment.