Skip to content

Commit ac572af

Browse files
committed
feat: changed globalEnv to globalEndNodeVersion and added dependencies for wait-github-ssh-key
1 parent 79d37f4 commit ac572af

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

src/resources/git/clone/git-repository.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export class GitCloneResource extends Resource<GitCloneConfig> {
5757
dependencies: [
5858
'ssh-key',
5959
'ssh-add-key',
60-
'ssh-config'
60+
'ssh-config',
61+
'wait-github-ssh-key'
6162
]
6263
}
6364
}

src/resources/git/wait-github-ssh-key/wait-github-ssh-key.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ export class WaitGithubSshKey extends Resource<WaitGithubSshKeyConfig> {
1414
getSettings(): ResourceSettings<WaitGithubSshKeyConfig> {
1515
return {
1616
id: 'wait-github-ssh-key',
17+
dependencies: [
18+
'ssh-key',
19+
'ssh-add-key',
20+
'ssh-config',
21+
]
1722
}
1823
}
1924

src/resources/node/pnpm/pnpm-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"type": "string",
1010
"description": "A specific version of pnpm to install. (defaults to the latest)"
1111
},
12-
"globalEnv": {
12+
"globalEnvNodeVersion": {
1313
"type": "string",
1414
"description": "Set the global node version. Corresponds to pnpm env --global use"
1515
}

test/node/pnpm/pnpm.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { PluginTester } from 'codify-plugin-test';
33
import path from 'node:path';
44
import fs from 'node:fs';
55
import os from 'node:os';
6+
import { codifySpawn } from '../../../src/utils/codify-spawn';
67

78
describe('Pnpm tests', () => {
89
const pluginPath = path.resolve('./src/index.ts');
@@ -17,4 +18,19 @@ describe('Pnpm tests', () => {
1718
}
1819
})
1920
})
21+
22+
it('Can install nodeJS via pnpm', { timeout: 300000 }, async () => {
23+
await PluginTester.fullTest(pluginPath, [
24+
{ type: 'pnpm', globalEnvNodeVersion: '20' },
25+
], {
26+
validateApply: async () => {
27+
const result = await codifySpawn('node -v');
28+
expect(result.data.trim()).to.include('20')
29+
},
30+
validateDestroy: async () => {
31+
const zshFile = fs.readFileSync(path.join(os.homedir(), '.zshrc'), 'utf8')
32+
expect(zshFile.trim()).to.eq('');
33+
}
34+
})
35+
})
2036
})

0 commit comments

Comments
 (0)