fix: Remove stupid toml
All checks were successful
Release / Release (push) Successful in 33s

This commit is contained in:
Jan K9f 2025-06-19 16:16:17 +02:00
commit a38aedc248
Signed by: jank
GPG key ID: 22BEAC760B3333D6
3 changed files with 1263 additions and 15 deletions

View file

@ -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);