2 #include <bbtkConfigurationFile.h>
3 #include <bbtkUtilities.h>
8 //==========================================================================
9 int main(int argc, char **argv)
13 std::cout << "usage : bbPlugPackage <path_to_package>" << std::endl;
17 std::string path(argv[1]);
18 std::string fname = path + "/bbtkPackage";
20 if ( ! Utilities::FileExists( fname ) )
22 std::cout << "* ERROR : The directory '"<<path<<"' does not contain a 'bbtkPackage' file"
28 f.open(fname.c_str());
34 ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );
40 command += ConfigurationFile::GetInstance().Get_bin_path();
41 command += ConfigurationFile::GetInstance().Get_file_separator();
42 command += "bbRegeneratePackageDoc";
46 command += " " + pname + " -q";
48 if ( system ( command.c_str() ) )
50 std::cout << "An error occured while running '"
51 << command << "'" << std::endl;
61 command += ConfigurationFile::GetInstance().Get_bin_path();
62 command += ConfigurationFile::GetInstance().Get_file_separator();
63 command += "bbRegenerateBoxesLists";
69 if ( ! system ( command.c_str() ) )
71 std::cout << "Package '"
72 << pname << "' successfully plugged in" << std::endl;
76 std::cout << "An error occured while running '"
77 << command << "'" << std::endl;
82 //==========================================================================