This commit is contained in:
parent
e77e7fbac8
commit
a38aedc248
3 changed files with 1263 additions and 15 deletions
|
@ -1,6 +1,5 @@
|
|||
import fs from "fs";
|
||||
import os from "os";
|
||||
import * as toml from "@std/toml";
|
||||
|
||||
export const configPath = os.homedir() + "/.config/project-cli/";
|
||||
|
||||
|
@ -21,9 +20,9 @@ export function getProjects(): Project[] {
|
|||
}
|
||||
|
||||
export function getConfiguration(): Configuration {
|
||||
return toml.parse(
|
||||
fs.readFileSync(configPath + "config.toml").toString(),
|
||||
) as unknown as Configuration;
|
||||
return JSON.parse(
|
||||
fs.readFileSync(configPath + "config.json").toString(),
|
||||
) as Configuration;
|
||||
}
|
||||
|
||||
export function addProject(project: Project) {
|
||||
|
@ -45,10 +44,8 @@ export function generateDefaultConfig() {
|
|||
cloningCommand: "git clone %s %n",
|
||||
};
|
||||
|
||||
const configString = toml.stringify(
|
||||
defaultConfig as unknown as Record<string, unknown>,
|
||||
);
|
||||
fs.writeFileSync(configPath + "config.toml", configString);
|
||||
const configString = JSON.stringify(defaultConfig);
|
||||
fs.writeFileSync(configPath + "config.json", configString);
|
||||
|
||||
const projects: Project[] = [];
|
||||
saveProjects(projects);
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/release-notes-generator": "^14.0.3",
|
||||
"@std/toml": "npm:@jsr/std__toml",
|
||||
"@types/commander": "^2.12.5",
|
||||
"@types/inquirer": "^9.0.8",
|
||||
"commander": "^14.0.0",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue