File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22
33# early exit
4- if [ " $is_sudo " = " 0" ]; then
4+ is_hdev_developer=$( $CLI_PATH /common/is_member $USER hdev_developers)
5+ is_sudo=$( $CLI_PATH /common/is_sudo $USER )
6+ if [ " $is_sudo " = " 0" ] && [ " $is_hdev_developer " = " 0" ]; then
57 exit
68fi
79
810# check on sudo
9- sudo_check $USER
11+ # sudo_check $USER
1012
1113# inputs (split the string into an array)
1214read -r -a flags_array <<< " $@"
@@ -56,8 +58,10 @@ cd $UPDATES_PATH
5658git clone $REPO_URL > /dev/null 2>&1 # https://github.com/fpgasystems/hdev.git
5759
5860# copy update
59- sudo mv $UPDATES_PATH /$REPO_NAME /update.sh $HDEV_PATH /update
60- sudo mv $UPDATES_PATH /$REPO_NAME /.update.sh $HDEV_PATH /.update
61+ # sudo mv $UPDATES_PATH/$REPO_NAME/update.sh $HDEV_PATH/update
62+ # sudo mv $UPDATES_PATH/$REPO_NAME/.update.sh $HDEV_PATH/.update
63+ sudo $CLI_PATH /common/mv $UPDATES_PATH /$REPO_NAME /.update.sh $HDEV_PATH /.update
64+ sudo $CLI_PATH /common/mv $UPDATES_PATH /$REPO_NAME /update.sh $HDEV_PATH /update
6165
6266# remove temporal copy
6367rm -rf $UPDATES_PATH /$REPO_NAME
Original file line number Diff line number Diff line change @@ -768,7 +768,7 @@ set_performance_help() {
768768# update ------------------------------------------------------------------------------------------------------------------------
769769
770770update_help () {
771- if [ " $is_sudo " = " 1" ]; then
771+ if [ " $is_sudo " = " 1" ] || [ " $is_hdev_developer " = " 1 " ] ; then
772772 # get latest tag
773773 # latest_tag=$(gh release list -R "$HDEV_REPO" --limit 1 --json tagName --jq '.[0].tagName')
774774 latest_tag=$( gh release list -R " $HDEV_REPO " -L 1 | awk ' {print $1}' )
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ cli_help() {
141141 else
142142 echo " ${bold} set${normal} - Devices and host configuration."
143143 fi
144- if [ " $is_sudo " = " 1" ]; then
144+ if [ " $is_sudo " = " 1" ] || [ " $is_hdev_developer " = " 1 " ] ; then
145145 echo " ${bold} update${normal} - Updates ${bold} $CLI_NAME ${normal} to a specific version."
146146 fi
147147 echo " ${bold} validate${normal} - Infrastructure functionality assessment."
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ _hdev_completions()
138138 fi
139139
140140 # Check on groups
141- if [ " $is_sudo " = " 1" ]; then
141+ if [ " $is_sudo " = " 1" ] || [ " $is_hdev_developer " = " 1 " ] ; then
142142 commands=" ${commands} reboot update"
143143 fi
144144 # if [ "$is_sudo" = "1" ]; then
Original file line number Diff line number Diff line change @@ -20,8 +20,9 @@ chmod_x() {
2020}
2121
2222# early exit
23+ is_hdev_developer=$( $CLI_PATH /common/is_member $USER hdev_developers)
2324is_sudo=$( $CLI_PATH /common/is_sudo $USER )
24- if [ " $is_sudo " = " 0" ]; then
25+ if [ " $is_sudo " = " 0" ] && [ " $is_hdev_developer " = " 0 " ] ; then
2526 exit
2627fi
2728
You can’t perform that action at this time.
0 commit comments