Skip to content

Commit e7ddd61

Browse files
committed
feat(github-files): set node version 20
1 parent d69212f commit e7ddd61

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

packages/github-files/index.mjs

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
11
#!/usr/bin/env node
2-
3-
import childProcess from 'node:child_process'
42
import fs from 'node:fs'
53
import path from 'node:path'
6-
import { exit } from 'node:process'
7-
import { fileURLToPath } from 'node:url'
4+
import process from 'node:process'
85

96
import pkg from './package.json' with { type: 'json' }
107
import { saveFile } from './save-file.mjs'
118

12-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
9+
const __dirname = path.dirname(new URL(import.meta.url).pathname)
10+
const currentPath = process.cwd()
1311
let isUsingConventionalCommits = false
14-
let gitRoot
1512

1613
console.info(`[${pkg.name}] Running...`)
1714

18-
try {
19-
gitRoot = childProcess
20-
.execSync('git rev-parse --show-toplevel')
21-
.toString()
22-
.trim()
23-
} catch {
24-
console.error(`\u001B[0;31m[${pkg.name}] Could not get root path\u001B[0m`)
25-
exit()
26-
}
27-
2815
// check if uses conventional commits
2916
const installedPackages = JSON.parse(
30-
fs.readFileSync(path.join(gitRoot, 'package.json'), 'utf8'),
17+
fs.readFileSync(path.join(currentPath, 'package.json'), 'utf8'),
3118
)
3219

3320
if (
@@ -37,7 +24,7 @@ if (
3724
isUsingConventionalCommits = true
3825
}
3926

40-
const githubDestinationFolder = path.join(gitRoot, '.github')
27+
const githubDestinationFolder = path.join(currentPath, '.github')
4128

4229
const codeOwnersFileName = 'CODEOWNERS'
4330
const codeOwnersSource = path.join(__dirname, 'assets', codeOwnersFileName)

packages/github-files/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"semantic-prs"
1717
],
1818
"engines": {
19-
"node": ">=22"
19+
"node": ">=20"
2020
},
2121
"type": "module",
2222
"license": "MIT",

0 commit comments

Comments
 (0)