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" << std::endl;
27 f.open(fname.c_str());
33 ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );
39 command += ConfigurationFile::GetInstance().Get_bin_path();
40 command += ConfigurationFile::GetInstance().Get_file_separator();
41 command += "bbRegeneratePackageDoc";
45 command += " " + pname + " -q";
47 if ( system ( command.c_str() ) )
49 std::cout << "An error occured while running '"
50 << command << "'" << std::endl;
51 // return 1; Feature #1676 - DFGO
60 command += ConfigurationFile::GetInstance().Get_bin_path();
61 command += ConfigurationFile::GetInstance().Get_file_separator();
62 command += "bbRegenerateBoxesLists";
68 if ( ! system ( command.c_str() ) )
70 std::cout << "Package '"
71 << pname << "' successfully plugged in" << std::endl;
75 std::cout << "An error occured while running '"
76 << command << "'" << std::endl;
77 //return 1; Feature #1676 - DFGO
81 //==========================================================================