@yarnpkg/shell
Advanced tools
Comparing version 2.0.0-rc.2 to 2.0.0-rc.4
@@ -9,5 +9,5 @@ "use strict"; | ||
function cloneState(state, mergeWith = {}) { | ||
const newState = Object.assign({}, state, mergeWith); | ||
newState.environment = Object.assign({}, state.environment, mergeWith.environment); | ||
newState.variables = Object.assign({}, state.variables, mergeWith.variables); | ||
const newState = Object.assign(Object.assign({}, state), mergeWith); | ||
newState.environment = Object.assign(Object.assign({}, state.environment), mergeWith.environment); | ||
newState.variables = Object.assign(Object.assign({}, state.variables), mergeWith.variables); | ||
return newState; | ||
@@ -17,3 +17,3 @@ } | ||
[`cd`, async ([target, ...rest], opts, state) => { | ||
const resolvedTarget = fslib_1.ppath.resolve(state.cwd, fslib_1.NodeFS.toPortablePath(target)); | ||
const resolvedTarget = fslib_1.ppath.resolve(state.cwd, fslib_1.npath.toPortablePath(target)); | ||
const stat = await fslib_1.xfs.statPromise(resolvedTarget); | ||
@@ -30,3 +30,3 @@ if (!stat.isDirectory()) { | ||
[`pwd`, async (args, opts, state) => { | ||
state.stdout.write(`${fslib_1.NodeFS.fromPortablePath(state.cwd)}\n`); | ||
state.stdout.write(`${fslib_1.npath.fromPortablePath(state.cwd)}\n`); | ||
return 0; | ||
@@ -63,3 +63,3 @@ }], | ||
inputs.push(() => { | ||
return fslib_1.xfs.createReadStream(fslib_1.ppath.resolve(state.cwd, fslib_1.NodeFS.toPortablePath(args[u]))); | ||
return fslib_1.xfs.createReadStream(fslib_1.ppath.resolve(state.cwd, fslib_1.npath.toPortablePath(args[u]))); | ||
}); | ||
@@ -82,3 +82,3 @@ } | ||
{ | ||
outputs.push(fslib_1.xfs.createWriteStream(fslib_1.ppath.resolve(state.cwd, fslib_1.NodeFS.toPortablePath(args[u])))); | ||
outputs.push(fslib_1.xfs.createWriteStream(fslib_1.ppath.resolve(state.cwd, fslib_1.npath.toPortablePath(args[u])))); | ||
} | ||
@@ -88,3 +88,3 @@ break; | ||
{ | ||
outputs.push(fslib_1.xfs.createWriteStream(fslib_1.ppath.resolve(state.cwd, fslib_1.NodeFS.toPortablePath(args[u])), { flags: `a` })); | ||
outputs.push(fslib_1.xfs.createWriteStream(fslib_1.ppath.resolve(state.cwd, fslib_1.npath.toPortablePath(args[u])), { flags: `a` })); | ||
} | ||
@@ -309,3 +309,3 @@ break; | ||
return pipe_2.makeProcess(rest[0], rest.slice(1), opts, { | ||
cwd: fslib_1.NodeFS.fromPortablePath(state.cwd), | ||
cwd: fslib_1.npath.fromPortablePath(state.cwd), | ||
env: state.environment, | ||
@@ -361,3 +361,3 @@ }); | ||
const environment = await applyEnvVariables(current.envs, opts, state); | ||
activeState.environment = Object.assign({}, activeState.environment, environment); | ||
activeState.environment = Object.assign(Object.assign({}, activeState.environment), environment); | ||
action = makeCommandAction([`true`], opts, activeState); | ||
@@ -531,3 +531,3 @@ } | ||
} | ||
async function execute(command, args = [], { builtins = {}, cwd = fslib_1.NodeFS.toPortablePath(process.cwd()), env = process.env, stdin = process.stdin, stdout = process.stdout, stderr = process.stderr, variables = {}, } = {}) { | ||
async function execute(command, args = [], { builtins = {}, cwd = fslib_1.npath.toPortablePath(process.cwd()), env = process.env, stdin = process.stdin, stdout = process.stdout, stderr = process.stderr, variables = {}, } = {}) { | ||
const normalizedEnv = {}; | ||
@@ -534,0 +534,0 @@ for (const [key, value] of Object.entries(env)) |
@@ -30,3 +30,3 @@ "use strict"; | ||
: stdio[2]; | ||
const child = cross_spawn_1.default(name, args, Object.assign({}, spawnOpts, { stdio: [ | ||
const child = cross_spawn_1.default(name, args, Object.assign(Object.assign({}, spawnOpts), { stdio: [ | ||
stdin, | ||
@@ -33,0 +33,0 @@ stdout, |
{ | ||
"name": "@yarnpkg/shell", | ||
"version": "2.0.0-rc.2", | ||
"version": "2.0.0-rc.4", | ||
"main": "./lib/index.js", | ||
"dependencies": { | ||
"@yarnpkg/fslib": "2.0.0-rc.3", | ||
"@yarnpkg/parsers": "2.0.0-rc.3", | ||
"@yarnpkg/fslib": "2.0.0-rc.11", | ||
"@yarnpkg/parsers": "2.0.0-rc.6", | ||
"cross-spawn": "^6.0.5", | ||
@@ -12,9 +12,7 @@ "stream-buffers": "^3.0.2" | ||
"devDependencies": { | ||
"@yarnpkg/pnpify": "2.0.0-rc.3", | ||
"tmp": "^0.0.33", | ||
"typescript": "^3.5.3" | ||
"tmp": "^0.1.0" | ||
}, | ||
"scripts": { | ||
"postpack": "rm -rf lib", | ||
"prepack": "mkdir -p lib && rsync -a --exclude '*.ts' sources/ lib/ && pnpify tsc", | ||
"prepack": "run build:compile \"$(pwd)\"", | ||
"release": "yarn npm publish", | ||
@@ -21,0 +19,0 @@ "test:shell": "run test:unit packages/yarnpkg-shell" |
1
34864
+ Added@yarnpkg/fslib@2.0.0-rc.11(transitive)
+ Added@yarnpkg/libzip@2.0.0-rc.5(transitive)
+ Added@yarnpkg/parsers@2.0.0-rc.6(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedtmp@0.1.0(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removed@yarnpkg/fslib@2.0.0-rc.3(transitive)
- Removed@yarnpkg/libzip@2.0.0-rc.3(transitive)
- Removed@yarnpkg/parsers@2.0.0-rc.3(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedtmp@0.0.33(transitive)
Updated@yarnpkg/fslib@2.0.0-rc.11
Updated@yarnpkg/parsers@2.0.0-rc.6