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 );
37 command = ConfigurationFile::GetInstance().Get_bin_path();
38 command += ConfigurationFile::GetInstance().Get_file_separator();
39 command += "bbRegeneratePackageDoc " + pname + " -q && ";
40 command += ConfigurationFile::GetInstance().Get_bin_path();
41 command += ConfigurationFile::GetInstance().Get_file_separator();
42 command += "bbRegenerateBoxesLists -q ";
44 if ( ! system ( command.c_str() ) )
46 std::cout << "Package '"
47 << pname << "' successfully plugged in" << std::endl;
51 std::cout << "An error occured while running '"
52 << command << "'" << std::endl;
57 //==========================================================================