This commit is contained in:
Namhyeon Go 2022-02-28 19:33:54 +09:00
parent 62b46d1dc3
commit 879708da6a
4 changed files with 30 additions and 8 deletions

View File

@ -214,7 +214,11 @@ function includeFile(FN) {
}
function appendFile(FN, content, charset) {
return writeFile(FN, readFile(FN, charset) + content, charset);
if (fileExists(FN)) {
return writeFile(FN, readFile(FN, charset) + content, charset);
} else {
return writeFile(FN, content, charset);
}
}
exports.fileExists = fileExists;

14
lib/nmap.js Normal file
View File

@ -0,0 +1,14 @@
////////////////////////////////////////////////////////////////////////
// NMAP API
////////////////////////////////////////////////////////////////////////
var NMAPObject = function() {
this.binPath = "bin\\32bit\\nmap-7.92\\nmap.exe";
this.start = function() {
var cmd = [];
// .. todo ..
};
};
exports.NMAPObject = NMAPObject;

View File

@ -159,9 +159,17 @@ exports.run = function(cmd, fork) {
return (new ShellObject()).run(cmd, fork);
};
exports.runVisibleWindow = function(cmd, fork) {
exports.show = function(cmd, fork) {
return (new ShellObject()).setVisibleWindow(true).run(cmd, fork);
}
};
exports.runAs = function(FN, args) {
return (new ShellObject()).runAs(FN, args);
};
exports.showAs = function(FN, args) {
return (new ShellObject()).setVisibleWindow(true).runAs(FN, args);
};
exports.createProcess = function(cmd, workingDirectory) {
if (typeof(workingDirectory) !== "undefined") {
@ -170,10 +178,6 @@ exports.createProcess = function(cmd, workingDirectory) {
return (new ShellObject()).setWorkingDirectory(workingDirectory).createProcess(cmd);
};
exports.runAs = function(FN, args) {
return (new ShellObject()).runAs(FN, args);
};
exports.createDesktopIcon = function(name, cmd, workingDirectory) {
return (new ShellObject()).createDesktopIcon(name, cmd, workingDirectory);
};

View File

@ -54,4 +54,4 @@ exports.confirm = function(message) {
exports.prompt = function(message, _default) {
return exports.getInterface().Prompt(message, _default);
};
};