Skip to content

Commit

Permalink
Update script to update Node.js with new Dockerfile in proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed May 18, 2024
1 parent 7555f2e commit 8246ec8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/update-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function printUpdate(tool: string, prev: string, next: string): void {
}

let Dockerfile = read(join(ROOT, '.devcontainer', 'Dockerfile'))
let currentNode = Dockerfile.match(/NODE_VERSION (.*)/)![1]!
let currentPnpm = Dockerfile.match(/PNPM_VERSION (.*)/)![1]!
let currentNode = Dockerfile.match(/NODE_VERSION (.+)/)![1]!
let currentPnpm = Dockerfile.match(/PNPM_VERSION (.+)/)![1]!

let latestNode = await getLatestNodeVersion(
process.argv[2] ?? currentNode.split('.')[0]!
Expand All @@ -82,7 +82,7 @@ if (currentNode !== latestNode) {
writeFileSync(join(ROOT, '.node-version'), latestNode + '\n')

updateProjectDockerfiles(dockerfile => {
return dockerfile.replace(/node:[\d.]+-*/, `node:${latestNode}-`)
return dockerfile.replace(/NODE_VERSION=.+*/, `NODE_VERSION=${latestNode}`)
})

let minor = latestNode.split('.').slice(0, 2).join('.')
Expand Down

0 comments on commit 8246ec8

Please sign in to comment.