2 #include <bbtkConfigurationFile.h>
3 #include <bbtkUtilities.h>
5 //==========================================================================
6 int main(int argc, char **argv)
10 std::cout << "usage : bbPlugPackage <path_to_package>" << std::endl;
14 std::string path(argv[1]);
15 std::string fname = path + "/bbtkPackage";
17 if ( ! Utilities::FileExists( fname ) )
19 std::cout << "* ERROR : The directory '"<<path<<"' does not contain a 'bbtkPackage' file"
25 f.open(fname.c_str());
31 ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );
34 command = ConfigurationFile::GetInstance().Get_bin_path();
35 command += ConfigurationFile::GetInstance().Get_file_separator();
36 command += "bbRegeneratePackageDoc " + pname + " -q && ";
37 command += ConfigurationFile::GetInstance().Get_bin_path();
38 command += ConfigurationFile::GetInstance().Get_file_separator();
39 command += "bbRegenerateBoxesLists -q ";
41 if ( ! system ( command.c_str() ) )
43 std::cout << "Package '"
44 << pname << "' successfully plugged in" << std::endl;
48 std::cout << "An error occured while running '"
49 << command << "'" << std::endl;
54 //==========================================================================