-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
32 lines (32 loc) · 911 Bytes
/
main.js
File metadata and controls
32 lines (32 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env node
let inputArr= process.argv.slice(2);//make an array of given sentences by slicing first 2
let fs=require("fs");
let path=require("path");
let helpObj=require("./commands/help");
let organizeObj=require("./commands/organize");
let treeObj=require("./commands/tree");
//console.log(inputArr);
//node main.js tree "directoryPath"
//node main.js organize "directoryPath"
//node main.js tree "directoryPath"
//node main.js help
let command=inputArr[0];
let types={
media:["mp4", "mkv"],
archives:['zip', '7s', 'rar'],
documents:['docs', 'doc','pdf', 'xlsx', 'xls', 'txt'],
app:['exe', 'pkg']
}
switch(command){
case "tree":
treeObj.treeKey(inputArr[1]);
break;
case "organize":
organizeObj.organizeKey(inputArr[1]);
break;
case "help":
helpObj.helpkey();
break;
default:
console.log("pls give input😊")
}