Skip to content

Commit

Permalink
Fix windows git install (#2017)
Browse files Browse the repository at this point in the history
* fix git install on windows w/yarn due to spawn issue(?)

* try e2e

* tweak e2e

* fix

* turn off e2es; it works
  • Loading branch information
cspotcode authored May 8, 2023
1 parent 89a266d commit 7af5c48
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
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

0 comments on commit 7af5c48

Please sign in to comment.