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 windows git install #2017

Merged
merged 5 commits into from
May 8, 2023
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
8 changes: 4 additions & 4 deletions .github/workflows/e2e-git-installs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
npm --version
echo '{"scripts": {"test": "ts-node -vvv"}}' > package.json
npm install /~https://github.com/TypeStrong/ts-node#main
npm install /~https://github.com/TypeStrong/ts-node#${{ github.ref_name }}
npm test
pnpm:
name: "pnpm"
Expand All @@ -49,7 +49,7 @@ jobs:
corepack prepare pnpm@latest --activate
pnpm --version
echo '{"scripts": {"test": "ts-node -vvv"}}' > package.json
pnpm install /~https://github.com/TypeStrong/ts-node#main
pnpm install /~https://github.com/TypeStrong/ts-node#${{ github.ref_name }}
pnpm test
yarn:
name: "yarn"
Expand All @@ -70,7 +70,7 @@ jobs:
corepack prepare yarn@stable --activate
yarn --version
echo '{"scripts": {"test": "ts-node -vvv"}}' > package.json
yarn add ts-node@/~https://github.com/TypeStrong/ts-node#main
yarn add ts-node@/~https://github.com/TypeStrong/ts-node#${{ github.ref_name }}
yarn add typescript
yarn test
yarn1:
Expand All @@ -93,5 +93,5 @@ jobs:
yarn --version
yarn cache list
echo '{"scripts": {"test": "ts-node -vvv"}}' > package.json
yarn add /~https://github.com/TypeStrong/ts-node#main
yarn add /~https://github.com/TypeStrong/ts-node#${{ github.ref_name }}
yarn test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"@types/semver": "^7.1.0",
"ava": "^5.1.1",
"axios": "^0.21.1",
"cross-spawn": "^7.0.3",
"dprint": "^0.25.0",
"expect": "27.0.2",
"lodash": "^4.17.15",
Expand Down
18 changes: 6 additions & 12 deletions scripts/prepack.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import { spawnSync } from 'child_process';
const { npm_node_execpath, npm_execpath } = process.env;
import { readFileSync } from 'fs';
const { npm_execpath } = process.env;

// prepack is executed by user's package manager when they install from git
// So cannot assume yarn

if (process.env.TS_NODE_SKIP_PREPACK == null) {
if (readFileSync(npm_execpath, 'utf8').match(/^#!.*sh/)) {
spawnSync(npm_execpath, ['run', 'prepack-worker'], {
stdio: 'inherit',
});
} else {
spawnSync(npm_node_execpath, [npm_execpath, 'run', 'prepack-worker'], {
stdio: 'inherit',
});
}
const crossSpawn = await import('cross-spawn');
const result = crossSpawn.sync(npm_execpath, ['run', 'prepack-worker'], {
stdio: 'inherit',
});
process.exit(result.status);
}
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3825,6 +3825,7 @@ __metadata:
arg: ^4.1.0
ava: ^5.1.1
axios: ^0.21.1
cross-spawn: ^7.0.3
diff: ^4.0.1
dprint: ^0.25.0
expect: 27.0.2
Expand Down