This commit is contained in:
2020-07-20 03:34:22 +09:00
parent dbec9f8c79
commit be1c48c035
12 changed files with 869 additions and 27 deletions

View File

@@ -50,11 +50,9 @@ export async function dot(args: string[], options: DotOption[]) {
}
} else if (flags._[0] === "unlink" && target.link) {
for (const value in target.link) {
const from = target.link[value];
const to = `${Deno.env.get("HOME")}/${value}`;
try {
if (existsSync(to)) {
if (Deno.readLinkSync(to) !== Deno.realPathSync(from)) continue;
Deno.removeSync(to);
console.log(`Unlink: ${to}`);
}