cli: add --pro and --primitive options

This commit is contained in:
Benjamin Canac
2024-04-18 12:36:42 +02:00
parent be53873c1a
commit dc6f830785
3 changed files with 78 additions and 29 deletions

View File

@@ -8,10 +8,10 @@ export async function sortFile(path) {
await fsp.writeFile(path, lines.join('\n') + '\n')
}
export async function appendFile(path, content) {
export async function appendFile(path, contents) {
const file = await fsp.readFile(path, 'utf-8')
if (!file.includes(content)) {
await fsp.writeFile(path, file.trim() + '\n' + content + '\n')
if (!file.includes(contents)) {
await fsp.writeFile(path, file.trim() + '\n' + contents + '\n')
}
}