Skip to content

Commit 6189c78

Browse files
fix: add cwd
1 parent dbe48ff commit 6189c78

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

pnpm-lock.yaml

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/create-lang/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ async function renameFiles(dir: string, answer: Answers) {
101101
}
102102
}
103103
}
104-
function installTreeSitterPackage(answer: Answers) {
104+
function installTreeSitterPackage(cwd: string, answer: Answers) {
105105
console.log('Installing tree-sitter package...')
106-
execSync(`pnpm install ${answer.treeSitterPackage} --save-dev --save-exact`)
106+
execSync(`pnpm install ${answer.treeSitterPackage} --save-dev --save-exact`, {
107+
cwd,
108+
})
107109
console.log('Copying source code...')
108-
execSync('pnpm run source')
110+
execSync('pnpm run source', { cwd })
109111
console.log('Compiling')
110-
execSync('pnpm run build')
112+
execSync('pnpm run build', { cwd })
111113
}
112114

113115
async function main() {
@@ -119,7 +121,7 @@ async function main() {
119121
const config = await askConfiguration()
120122
await copyTemplate(cwd, config.includeDotFiles)
121123
await renameFiles(cwd, config)
122-
installTreeSitterPackage(config)
124+
installTreeSitterPackage(cwd, config)
123125
}
124126

125127
main()

0 commit comments

Comments
 (0)