@@ -172,6 +172,9 @@ namespace parallax
172172 std::string repo_url =
173173 parallax::config::ConfigManager::GetInstance ().GetConfigValue (
174174 parallax::config::KEY_PRAKASA_GIT_REPO_URL);
175+ std::string git_branch =
176+ parallax::config::ConfigManager::GetInstance ().GetConfigValue (
177+ parallax::config::KEY_PRAKASA_GIT_BRANCH);
175178
176179 const std::string &proxy_url = context_->GetProxyUrl ();
177180
@@ -185,26 +188,26 @@ namespace parallax
185188 if (is_update_mode)
186189 {
187190 // Project is installed and has updates, only execute git pull update
188- std::string pull_cmd = " cd ~/prakasa && git pull" ;
191+ std::string pull_cmd = " cd ~/prakasa && git checkout " + git_branch + " && git pull" ;
189192 if (!proxy_url.empty ())
190193 {
191- pull_cmd = " cd ~/prakasa && ALL_PROXY=" + proxy_url + " git pull" ;
194+ pull_cmd = " cd ~/prakasa && git checkout " + git_branch + " && ALL_PROXY=" + proxy_url + " git pull" ;
192195 }
193196 commands.emplace_back (" update_parallax" , pull_cmd, 300 , false );
194197 }
195198 else
196199 {
197- // Project not installed, check if parallax directory exists, decide
200+ // Project not installed, check if prakasa directory exists, decide
198201 // whether to clone or pull
199202 auto [check_dir_code, check_dir_output] = executor_->ExecuteWSL (
200- " ls -la ~/parallax /.git 2>/dev/null || echo 'not found'" , 30 );
203+ " ls -la ~/prakasa /.git 2>/dev/null || echo 'not found'" , 30 );
201204
202205 if (check_dir_code == 0 &&
203206 check_dir_output.find (" not found" ) == std::string::npos)
204207 {
205208 // Directory exists, check if it's a git repository
206209 auto [check_git_code, check_git_output] = executor_->ExecuteWSL (
207- " cd ~/parallax && git branch 2>/dev/null || echo 'not git'" ,
210+ " cd ~/prakasa && git branch 2>/dev/null || echo 'not git'" ,
208211 30 );
209212
210213 if (check_git_code == 0 &&
@@ -214,11 +217,11 @@ namespace parallax
214217 info_log (
215218 " [ENV] Prakasa directory exists, updating with git "
216219 " pull..." );
217- std::string pull_cmd = " cd ~/prakasa && git pull" ;
220+ std::string pull_cmd = " cd ~/prakasa && git checkout " + git_branch + " && git pull" ;
218221 if (!proxy_url.empty ())
219222 {
220223 pull_cmd =
221- " cd ~/prakasa && ALL_PROXY=" + proxy_url + " git pull" ;
224+ " cd ~/prakasa && git checkout " + git_branch + " && ALL_PROXY=" + proxy_url + " git pull" ;
222225 }
223226 commands.emplace_back (" update_parallax" , pull_cmd, 300 , false );
224227 }
@@ -237,7 +240,7 @@ namespace parallax
237240 {
238241 clone_cmd += " ALL_PROXY=" + proxy_url + " " ;
239242 }
240- clone_cmd += " git clone " + repo_url;
243+ clone_cmd += " git clone -b " + git_branch + " " + repo_url;
241244 commands.emplace_back (" clone_prakasa" , clone_cmd, 600 , false );
242245 }
243246 }
@@ -251,7 +254,7 @@ namespace parallax
251254 {
252255 clone_cmd += " ALL_PROXY=" + proxy_url + " " ;
253256 }
254- clone_cmd += " git clone " + repo_url;
257+ clone_cmd += " git clone -b " + git_branch + " " + repo_url;
255258 commands.emplace_back (" clone_prakasa" , clone_cmd, 600 , false );
256259 }
257260 }
@@ -368,22 +371,25 @@ namespace parallax
368371
369372 bool ParallaxProjectInstaller::IsParallaxProjectInstalled ()
370373 {
371- // Check if parallax project is installed (need to check in virtual
374+ // Check if prakasa project is installed (need to check in virtual
372375 // environment)
373376 auto [check_code, check_output] = executor_->ExecuteWSL (
374- " cd ~/parallax && [ -d ./venv ] && source ./venv/bin/activate && pip "
375- " list | grep parallax " );
377+ " cd ~/prakasa && [ -d ./venv ] && source ./venv/bin/activate && pip "
378+ " list | grep prakasa " );
376379 return (check_code == 0 && !check_output.empty ());
377380 }
378381
379382 bool ParallaxProjectInstaller::HasParallaxProjectGitUpdates ()
380383 {
381384 const std::string &proxy_url = context_->GetProxyUrl ();
385+ std::string git_branch =
386+ parallax::config::ConfigManager::GetInstance ().GetConfigValue (
387+ parallax::config::KEY_PRAKASA_GIT_BRANCH);
382388
383- // Check if Parallax project has git updates
389+ // Check if Prakasa project has git updates
384390 // First check if git repository exists
385391 auto [check_git_code, check_git_output] = executor_->ExecuteWSL (
386- " cd ~/parallax && git rev-parse --is-inside-work-tree 2>/dev/null" , 30 );
392+ " cd ~/prakasa && git rev-parse --is-inside-work-tree 2>/dev/null" , 30 );
387393
388394 if (check_git_code != 0 )
389395 {
@@ -408,7 +414,7 @@ namespace parallax
408414
409415 // Check if there are differences between local and remote
410416 auto [diff_code, diff_output] = executor_->ExecuteWSL (
411- " cd ~/prakasa && git rev-list HEAD...origin/main --count 2>/dev/null" ,
417+ " cd ~/prakasa && git rev-list HEAD...origin/" + git_branch + " --count 2>/dev/null" ,
412418 30 );
413419
414420 if (diff_code == 0 && !diff_output.empty ())
0 commit comments