Skip to content

Commit 73edeb0

Browse files
committed
hdev_developers update
1 parent b370e02 commit 73edeb0

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

.update.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
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
68
fi
79

810
#check on sudo
9-
sudo_check $USER
11+
#sudo_check $USER
1012

1113
#inputs (split the string into an array)
1214
read -r -a flags_array <<< "$@"
@@ -56,8 +58,10 @@ cd $UPDATES_PATH
5658
git 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
6367
rm -rf $UPDATES_PATH/$REPO_NAME

cli/.hdev_help.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ set_performance_help() {
768768
# update ------------------------------------------------------------------------------------------------------------------------
769769

770770
update_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}')

cli/hdev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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."

cli/hdev_completion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

update.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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)
2324
is_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
2627
fi
2728

0 commit comments

Comments
 (0)