forked from Akash98Sky/rom_building_system_setup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv_setup.cpp
More file actions
32 lines (29 loc) · 664 Bytes
/
Copy pathenv_setup.cpp
File metadata and controls
32 lines (29 loc) · 664 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
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
void env_setup()
{
int flag=0;
ofstream fout;
fout.open("~/.profile",ios::app);
if(fout.is_open()){
fout<<"\n\n# set PATH so it includes user's private bin if it exists\nif [ -d \"$HOME/bin\" ] ; then\n\tPATH=\"$HOME/bin:$PATH\"\nfi\n";
fout<<"\n# add Android SDK platform tools to path\nif [ -d \"$HOME/platform-tools\" ] ; then\n\tPATH=\"$HOME/platform-tools:$PATH\"\nfi";
flag=1;
}
fout.close();
if(flag){
cout<< "\nsource ~/.profile";
cin.ignore();
getchar();
system("source ~/.profile");
cout<<endl;
}
}
int main()
{
env_setup();
cout<<endl;
return 0;
}