cout<<"\033[1;31m**** ERROR : A detector with name close to \033[1;36m"<<answer<<" \033[1;31malready exist. use \033[1;36m-f\033[1;31m flag to force recreation.\033[0m"<<endl;
cout<<"\033[1;31m**** ERROR : A detector with name close to \033[1;36m"<<DetectorName<<" \033[1;31malready exist. use \033[1;36m-f\033[1;31m flag to force recreation.\033[0m"<<endl;
exit(1);
exit(1);
}
}
}
}
...
@@ -146,104 +146,104 @@ int main(int argc , char** argv){
...
@@ -146,104 +146,104 @@ int main(int argc , char** argv){
<<"\033[0m and \033[1;35m"<<SimFile_cxx<<"\033[0m"<<std::endl;
<<"\033[0m and \033[1;35m"<<SimFile_cxx<<"\033[0m"<<std::endl;
std::cout<<std::endl;
std::cout<<std::endl;
...
@@ -281,12 +281,32 @@ int main(int argc , char** argv){
...
@@ -281,12 +281,32 @@ int main(int argc , char** argv){
<<InputFile<<"\033[0m"<<std::endl;
<<InputFile<<"\033[0m"<<std::endl;
std::cout<<std::endl;
std::cout<<std::endl;
// Adding file to git
stringgit;
std::cout<<"\033[1;36m-> Do you want to add those files to the nptool repository ? (y/n) \033[0m";
std::cin>>git;
if(git=="y"||git=="Y"){
command="git add -f "
+pathNPL+DetectorName+"/CMakeLists.txt "
+pathNPL+DetectorName+"/"+DataFile_h+" "
+pathNPL+DetectorName+"/"+DataFile_cxx+" "
+pathNPL+DetectorName+"/"+PhysicsFile_h+" "
+pathNPL+DetectorName+"/"+PhysicsFile_cxx+" "
+pathNPL+DetectorName+"/"+SpectraFile_h+" "
+pathNPL+DetectorName+"/"+SpectraFile_cxx+" "
+pathNPS+DetectorName+"/CMakeLists.txt "
+pathNPS+DetectorName+"/"+SimFile_h+" "
+pathNPS+DetectorName+"/"+SimFile_cxx+" "
+pathInputs+InputFile;
return_value=system(command.c_str());
if(return_value==0)
std::cout<<"\033[1;32m**** Files added, use \033[1;36mgit commit -a \033[1;32m to commit them when ready ****\033[0m"<<endl;
}
// Display help message
// Display help message
std::cout<<"\033[1;31mFor help editing those files visit http://nptool.org/manual/adding-detectors \033[0m"<<std::endl;
std::cout<<std::endl<<"\033[1;31m**** For help editing those files visit \033[1;36mhttp://nptool.org/manual/adding-detectors \033[1;31m****\033[0m"<<std::endl<<std::endl;