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