-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSYS.cpp
executable file
·82 lines (68 loc) · 1.66 KB
/
SYS.cpp
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <string>
int main( int argc, char *argv[] )
{
//Define
std::string InputStr="";
std::string OptionStr="";
//Cout
//std::cout<<"Command length is "<<std::endl;
//std::cout<<argc<<std::endl;
//Check
if(argc>1)
{
//Input
InputStr=argv[1];
//std::cout<<"InputStr is "<<std::endl;
//std::cout<<InputStr<<std::endl;
//Check
if(argc>2)
{
//Option
OptionStr=argv[2];
//std::cout<<"OptionStr is "<<std::endl;
//std::cout<<OptionStr<<std::endl;
}
//Check
if(InputStr == "install")
{
system("cd /Users/ledoux/Documents/ShareYourSystem/Pythonlogy;sudo sh install.sh");
}
if(InputStr == "pip")
{
system("cd /Users/ledoux/Documents/ShareYourSystem/Pythonlogy;sudo sh install.sh");
system("cd /Users/ledoux/Documents/ShareYourSystem/Pythonlogy;sudo sh upload.sh");
}
else if(InputStr == "document")
{
system("python /Users/ledoux/Documents/ShareYourSystem/Pythonlogy/document.py");
}
else if(InputStr == "GUI")
{
//Check
if(OptionStr == "local")
{
system("sudo shellinaboxd&");
}
//call the GUI.ipynb
system("cd /Users/ledoux/Documents/ShareYourSystem/ShareYourGUIstem;ipython notebook GUI.ipynb");
}
else if(InputStr == "meteor")
{
system("cd /Users/ledoux/Documents/ShareYourSystem/ShareYourGUIstem;meteor");
}
else if(InputStr == "docs")
{
system("cd /Users/ledoux/Documents/ShareYourSystem;mkdocs serve&");
system("cd /Applications/Firefox.app/Contents/MacOS/;./firefox -new-window 127.0.0.1:8000");
}
}
else
{
std::cout<<"You need to specify an input"<<std::endl;
}
//return
return 0;
}