kopia lustrzana https://github.com/robinmoisson/staticrypt
Added argument parsing and file reading.
rodzic
eab7422055
commit
10b0cebe31
22
cli/index.js
22
cli/index.js
|
@ -1,3 +1,21 @@
|
|||
for(var i = 0; i < 10; ++i){
|
||||
console.log("Main");
|
||||
var CryptoJS = require("crypto-js");
|
||||
var FileSystem = require("fs");
|
||||
|
||||
const argv = process.argv;
|
||||
const argc = process.argv.length;
|
||||
|
||||
if(argc != 4){
|
||||
console.log("Failure: invalid argument length!");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const htmlFilepath = argv[2];
|
||||
const password = argv[3];
|
||||
|
||||
try{
|
||||
var contents = FileSystem.readFileSync(htmlFilepath, 'utf8');
|
||||
}catch(e){
|
||||
console.log("Failure: file does not exist!");
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(contents);
|
||||
|
|
Ładowanie…
Reference in New Issue