- Upgraded niknaks

InitCommand

- Remove duplicate dependencies
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-28 15:28:06 +02:00
parent 41d782b699
commit 8e85087b4e
2 changed files with 8 additions and 1 deletions

View File

@ -7,7 +7,7 @@
"gogga": ">=3.1.1",
"jcli": "0.25.0-beta.3",
"tlang": "~feature/comments",
"niknaks": ">=0.15.2"
"niknaks": ">=0.15.4"
},
"description": "Tristan Programming Language package manager",
"license": "GPL v3",

View File

@ -13,6 +13,7 @@ import std.exception : ErrnoException;
import tpkg.lib.docgen;
import tlang.compiler.core : Compiler, gibFileData;
import niknaks.config : Registry;
import niknaks.arrays : unique;
public Registry* reg;
@ -83,6 +84,7 @@ struct InitCommand
Prompter prompter = new Prompter(stdin);
prompter.addPrompt(Prompt("Project name: ", false, false));
prompter.addPrompt(Prompt("Project description: ", false, false));
prompter.addPrompt(Prompt("Dependencies?: ", true));
Prompt[] answers = prompter.prompt();
@ -108,6 +110,11 @@ struct InitCommand
ERROR("Could not get a valid project description");
return;
}
string[] projDeps;
answers[2].getValues(projDeps);
projDeps = unique(projDeps);
DEBUG("Dependencies wanted: ", projDeps);
JSONValue json = proj.serialize();
string jsonStr = json.toPrettyString();