Skip to content

Commit db9b5ce

Browse files
authored
fix: package tool escape path on windows (#169)
* chore: update e2e tests to try npm and macos This should add more visibility if something is going wrong, like #167. * test: see if which properly resolves npm on windows * test: try with execution * test: try a couple of things including mkdirP and absolute toolpath * chore: try to pass the name of the packager instead * chore: remove the test code from the workflow
1 parent 9fce70f commit db9b5ce

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,22 @@ jobs:
2323
os:
2424
- ubuntu-latest
2525
- windows-latest
26+
- macos-latest
2627
cache:
2728
- with-cache
2829
- without-cache
30+
packager:
31+
- yarn
32+
include:
33+
- os: ubuntu-latest
34+
cache: without-cache
35+
packager: npm
36+
- os: windows-latest
37+
cache: without-cache
38+
packager: npm
39+
- os: macos-latest
40+
cache: without-cache
41+
packager: npm
2942
runs-on: ${{ matrix.os }}
3043
steps:
3144
- name: 🏗 Setup repo
@@ -38,6 +51,7 @@ jobs:
3851
eas-cache: ${{ matrix.cache == 'with-cache' }}
3952
expo-version: latest
4053
expo-cache: ${{ matrix.cache == 'with-cache' }}
54+
packager: ${{ matrix.packager }}
4155
token: ${{ secrets.EXPO_TOKEN }}
4256

4357
- name: 🧪 EAS installed

build/setup/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67049,9 +67049,8 @@ exports.resolvePackage = resolvePackage;
6704967049
*/
6705067050
async function installPackage(name, version, manager) {
6705167051
const temp = (0, worker_1.tempPath)(name, version);
67052-
const tool = await (0, io_1.which)(manager);
6705367052
await (0, io_1.mkdirP)(temp);
67054-
await (0, exec_1.exec)(tool, ['add', `${name}@${version}`], { cwd: temp });
67053+
await (0, exec_1.exec)(manager, ['add', `${name}@${version}`], { cwd: temp });
6705567054
return (0, worker_1.cacheTool)(temp, name, version);
6705667055
}
6705767056
exports.installPackage = installPackage;

src/packager.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { exec, getExecOutput } from '@actions/exec';
2-
import { which, mkdirP } from '@actions/io';
2+
import { mkdirP } from '@actions/io';
33

44
import { cacheTool, tempPath } from './worker';
55

@@ -37,10 +37,9 @@ export async function resolvePackage(name: string, range: string): Promise<strin
3737
*/
3838
export async function installPackage(name: string, version: string, manager: string) {
3939
const temp = tempPath(name, version);
40-
const tool = await which(manager);
4140

4241
await mkdirP(temp);
43-
await exec(tool, ['add', `${name}@${version}`], { cwd: temp });
42+
await exec(manager, ['add', `${name}@${version}`], { cwd: temp });
4443

4544
return cacheTool(temp, name, version);
4645
}

0 commit comments

Comments
 (0)