HTML-page is saved only if command line option --save is set

parent be7ed5f5
......@@ -60,10 +60,15 @@ void mainFn(string[] args) {
return;
}
bool save = (VitisConf.getAutosave == "yes") ? true : false;
bool confOptionSave = (VitisConf.getAutosave == "yes") ? true : false;
string destFileSpace;
getopt(args, config.passThrough, "save", &save, "to", &destFileSpace);
if (!destFileSpace.empty) save = true;
bool cliOptionSave = false;
getopt(args, config.passThrough, "save", &cliOptionSave,
"to", &destFileSpace);
if (!destFileSpace.empty) {
cliOptionSave = true;
}
bool save = confOptionSave || cliOptionSave;
//vitis assign [[-c] <category>] -f <file list>
string[] files = args.extractOptionRange("-f");
......@@ -161,7 +166,7 @@ void mainFn(string[] args) {
checkCondition!err(args.length == 1);
assignCategoriesToNetLinks(categories,
networkLinks,
save,
cliOptionSave,
userConfirmation,
userDenial);
return;
......@@ -944,18 +949,14 @@ private string[] createNonExistentCategories(string[] categories,
private string saveLinkEntry(string url) {
string linkEntriesDir;
bool HTML = amalthea.net.urlIsHTML(url);
if (HTML) {
linkEntriesDir = getHTMLLinkEntriesPath();
} else {
linkEntriesDir = getNonHTMLLinkEntriesPath();
}
string tempEntryPath;
string linkEntriesDir = HTML ? getHTMLLinkEntriesPath()
: getNonHTMLLinkEntriesPath();
string tempEntryPath; // path to desktop-file
tempEntryPath = amalthea.fs.createNetworkLink(url, std.file.tempDir);
scope(exit) rm(tempEntryPath);
// comments in entry is not used now
if (HTML) {
amalthea.fs.setFieldOfDesktopFile(tempEntryPath, "Comment", "html");
} else {
......
......@@ -107,6 +107,7 @@ void deleteCategories(string[] categories, bool force = false) {
}
}
string[] getSubcategories(string category) {
auto categoryPath = getCatDirPath(category);
auto dirList = amalthea.fs.getDirList(categoryPath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment