-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor script to organize commands into functions
- Created a new function: 'auth' - 'auth' is dedicated to the 'login' command - Modified 'rootUsage' to direct to these new functions based on user input - Updated help message to reflect the new command structure
- Loading branch information
1 parent
920e3aa
commit 6c7bd6b
Showing
7 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
authUsage() { | ||
echo "Usage: $0 credential [command]" | ||
echo "Commands:" | ||
echo " login - Login azure as service-principal" | ||
exit 1 | ||
} | ||
|
||
function auth(){ | ||
|
||
# Check if at least one argument is provided | ||
if [ $# -eq 0 ]; then | ||
authUsage | ||
fi | ||
|
||
# Execute the appropriate command | ||
case "$1" in | ||
login) | ||
login | ||
;; | ||
*) | ||
echo "Error: Invalid command." | ||
authUsage | ||
;; | ||
esac | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
source auth/Login.sh | ||
source auth/driver.sh |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
source credential/loadScripts.sh | ||
source auth/loadScripts.sh | ||
|
||
source Login.sh |