Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): replace binjumper with cmd script without prompt #1939

Merged
merged 2 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .pnp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
32 changes: 32 additions & 0 deletions .yarn/versions/2859f37f.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/core": patch
"@yarnpkg/plugin-dlx": patch
"@yarnpkg/plugin-essentials": patch
"@yarnpkg/plugin-exec": patch
"@yarnpkg/plugin-init": patch
"@yarnpkg/plugin-workspace-tools": patch
"@yarnpkg/pnpify": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-file"
- "@yarnpkg/plugin-git"
- "@yarnpkg/plugin-github"
- "@yarnpkg/plugin-http"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-link"
- "@yarnpkg/plugin-node-modules"
- "@yarnpkg/plugin-npm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- vscode-zipfs
- "@yarnpkg/builder"
- "@yarnpkg/doctor"
- "@yarnpkg/pnp"
1 change: 0 additions & 1 deletion packages/yarnpkg-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@yarnpkg/parsers": "workspace:^2.3.0",
"@yarnpkg/pnp": "workspace:^2.3.2",
"@yarnpkg/shell": "workspace:^2.4.1",
"binjumper": "^0.1.4",
"camelcase": "^5.3.1",
"chalk": "^3.0.0",
"ci-info": "^2.0.0",
Expand Down
9 changes: 3 additions & 6 deletions packages/yarnpkg-core/sources/scriptUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {CwdFS, Filename, NativePath, PortablePath, ZipOpenFS} from '@yarnpkg/fsl
import {xfs, npath, ppath, toFilename} from '@yarnpkg/fslib';
import {getLibzipPromise} from '@yarnpkg/libzip';
import {execute} from '@yarnpkg/shell';
import {getBinjumper} from "binjumper";
import capitalize from 'lodash/capitalize';
import pLimit from 'p-limit';
import {PassThrough, Readable, Writable} from 'stream';
Expand Down Expand Up @@ -30,11 +29,9 @@ enum PackageManager {

async function makePathWrapper(location: PortablePath, name: Filename, argv0: NativePath, args: Array<string> = []) {
if (process.platform === `win32`) {
await Promise.all([
xfs.writeFilePromise(ppath.format({dir: location, name, ext: `.exe`}), getBinjumper()),
xfs.writeFilePromise(ppath.format({dir: location, name, ext: `.exe.info`}), [argv0, ...args].join(`\n`)),
xfs.writeFilePromise(ppath.format({dir: location, name, ext: `.cmd`}), `@"${argv0}" ${args.map(arg => `"${arg.replace(`"`, `""`)}"`).join(` `)} %*\n`),
]);
// https://github.com/microsoft/terminal/issues/217#issuecomment-737594785
const cmdScript = `@goto #_undefined_# 2>NUL || @title %COMSPEC% & @"${argv0}" ${args.map(arg => `"${arg.replace(`"`, `""`)}"`).join(` `)} %*`;
await xfs.writeFilePromise(ppath.format({dir: location, name, ext: `.cmd`}), cmdScript);
}

await xfs.writeFilePromise(ppath.join(location, name), `#!/bin/sh\nexec "${argv0}" ${args.map(arg => `'${arg.replace(/'/g, `'"'"'`)}'`).join(` `)} "$@"\n`);
Expand Down
8 changes: 0 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5502,7 +5502,6 @@ __metadata:
"@yarnpkg/plugin-pnp": "workspace:^2.4.0"
"@yarnpkg/pnp": "workspace:^2.3.2"
"@yarnpkg/shell": "workspace:^2.4.1"
binjumper: ^0.1.4
camelcase: ^5.3.1
chalk: ^3.0.0
ci-info: ^2.0.0
Expand Down Expand Up @@ -7704,13 +7703,6 @@ __metadata:
languageName: node
linkType: hard

"binjumper@npm:^0.1.4":
version: 0.1.4
resolution: "binjumper@npm:0.1.4"
checksum: 07b0f2cf66698c0087e5916e0848ad4a7a0c85b6980689cea443baef9beac2001d4b818d9b99347208eef2b9dfa17095e84b617e472efdea694e7009b54cad91
languageName: node
linkType: hard

"bl@npm:^1.0.0":
version: 1.2.2
resolution: "bl@npm:1.2.2"
Expand Down