Skip to content

Commit 98036fc

Browse files
committed
Fixes check against windows paths
1 parent dac4134 commit 98036fc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cli/commands/policies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {stringify} from '../../lockfile';
1212
import {satisfiesWithPrereleases} from '../../util/semver.js';
1313
import {NODE_BIN_PATH} from '../../constants';
1414

15-
const V2_NAMES = ['stable', 'berry', 'stable', 'canary', 'v2', '2'];
15+
const V2_NAMES = ['berry', 'stable', 'canary', 'v2', '2'];
1616

1717
const isLocalFile = (version: string) => version.match(/^\.{0,2}[\\/]/) || path.isAbsolute(version);
1818
const isV2Version = (version: string) => satisfiesWithPrereleases(version, '>=2.0.0');

src/util/child.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let uid = 0;
1818
export const exec = promisify(child.exec);
1919

2020
function validate(program: string, opts?: Object = {}) {
21-
if (program.includes('/')) {
21+
if (program.match(/[\\\/]/)) {
2222
return;
2323
}
2424

0 commit comments

Comments
 (0)