Added shell arguments to sos-git
This commit is contained in:
parent
3b3b4bb65d
commit
30a9ff1e8a
1 changed files with 10 additions and 4 deletions
14
sos-git.sh
14
sos-git.sh
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
function getDefaultConfiguration() {
|
||||
# SOSGIT_CONFIGVERSION=4
|
||||
# SOSGIT_CONFIGVERSION=5
|
||||
# # sos-git configuration\n
|
||||
# # this is the default configuration, you\n
|
||||
# # may make changes in sos-git.conf.d\n
|
||||
|
@ -12,6 +12,12 @@ function getDefaultConfiguration() {
|
|||
# ## DEFAULT: /bin/sh\n
|
||||
# ## You may want to set this to /bin/bash\n
|
||||
# #SOSGIT_SHELL=/bin/sh\n
|
||||
# \n
|
||||
# ## Shell arguments\n
|
||||
# ## DEFAULT:\n
|
||||
# ## Here you can define your custom shell\n
|
||||
# ## arguments, like another rcfile.\n
|
||||
# #SOSGIT_SHELLARGS=\n
|
||||
# #\n
|
||||
# ## Make\n
|
||||
# ## DEFAULT: /bin/make\n
|
||||
|
@ -125,11 +131,11 @@ function getDefaultConfiguration() {
|
|||
# ## DEFAULT: false\n
|
||||
# ## Disables the root warning\n
|
||||
# #SOSGIT_NOROOTWARNING=false\n
|
||||
export "SOSGIT_EXITSTRING=SOSGIT_CONFIGVERSION=4\n# sos-git configuration\n# this is the default configuration, you\n# may make changes in sos-git.conf.d\n# since they may get overriten in a future\n# update.\n\n# Commands\n## Shell\n## DEFAULT: /bin/sh\n## You may want to set this to /bin/bash\n#SOSGIT_SHELL=/bin/sh\n#\n## Make\n## DEFAULT: /bin/make\n#SOSGIT_MAKE=/bin/make\n#\n## Editor\n## DEFAULT: /bin/nano\n## You may want to set this to /bin/vi\n## or /bin/vim or any other editor.\n#SOSGIT_EDITOR=/bin/nano\n#\n## cURL\n## DEFAULT: /bin/curl\n#SOSGIT_CURL=/bin/curl\n#\n## git\n## DEFAULT: /bin/git\n#SOSGIT_GIT=/bin/git\n#\n## ls\n## DEFAULT: /bin/ls\n## The ls command must be from GNU\n## coreutils, otherwise it may not\n## work correctly with sos-git.\n#SOSGIT_LS=/bin/ls\n#\n## rm\n## DEFAULT: /bin/rm\n## The rm command must be from GNU\n## coreutils, otherwise it may not\n## work correctly with sos-git.\n#SOSGIT_RM=/bin/rm\n#\n## mkdir\n## DEFAULT: /bin/mkdir\n## The mkdir command must be from\n## GNU coreutils, otherwise it may\n## not work correctly with sos-git.\n#SOSGIT_MKDIR=/bin/mkdir\n#\n## mv\n## DEFAULT: /bin/mv\n## The mv command must be from GNU\n## coreutils, otherwise it may not\n## work correctly with sos-git.\n#SOSGIT_MV=/bin/mv\n#\n## chmod\n## DEFAULT: /bin/chmod\n## The chmod command must be from\n## GNU coreutils, otherwise it may\n## not work correctly with sos-git.\n#SOSGIT_CHMOD=/bin/chmod\n\n# Title\n## Suppress\n## DEFAULT: false\n## This hides the branding at\n## startup completely.\n#SOSGIT_TITLE_SUPPRESS=false\n#\n## Text\n## DEFAULT: false\n## This prints the branding\n## at startup in normal text.\n#SOSGIT_TITLE_TEXT=false\n\n# Temp\n# DEFAULT: /dev/shm\n# The temporary directory.\n# NO TRAILING SLASH AT THE END!\n#SOSGIT_TMP=/dev/shm\n\n# Repository save directory\n# DEFAULT: \$HOME/.sostools/git/repos\n# The directory where your downloaded\n# repositories are stored.\n# NO TRAILING SLASH AT THE END!\n# NO ~, USE \$HOME INSTEAD!\n#SOSGIT_REPOS=\$HOME/.sostools/git/repos\n\n# Internet\n## Update URL\n## DEFAULT: https://staropensource.ddns.net\n## /git/staropensource/sostools\n## /raw/branch/master/sos-git.sh\n## The update URL, from where sos-git gets\n## updates. The save location will be\n## determined from the command line arguments.\n#SOSGIT_UPDATEURL=https://staropensource.ddns.net/git/staropensource/sostools/raw/branch/master/sos-git.sh\n#\n## Request string\n## DEFAULT: https://staropensource.ddns.net\n## /git/%s/%s\n## String is used for making requests and\n## downloading repositories. First %s is user,\n## second %s is the repository.\n## NO TRAILING SLASH AT THE END!\n#SOSGIT_REQUESTSTRING=https://staropensource.ddns.net/git/%s/%s\n#\n## Remote request string\n## DEFAULT: https://%s:%s@staropensource.ddns.net/%s/%s## String is used for remoteauth, that updates\n## the remote string in git. First %s is username,\n## second %s is password, third %s is user and\n## fourth %s is the repository.\n## NO TRAILING SLASH AT THE END!\n#SOSGIT_REQUESTSTRING_REMOTE=https://%s:%s@staropensource.ddns.net/%s/%s\n# No root warning\n## DEFAULT: false\n## Disables the root warning\n#SOSGIT_NOROOTWARNING=false\n"
|
||||
export "SOSGIT_EXITSTRING=SOSGIT_CONFIGVERSION=5\n# sos-git configuration\n# this is the default configuration, you\n# may make changes in sos-git.conf.d\n# since they may get overriten in a future\n# update.\n\n# Commands\n## Shell\n## DEFAULT: /bin/sh\n## You may want to set this to /bin/bash\n#SOSGIT_SHELL=/bin/sh\n#\n## Shell arguments\n## DEFAULT:\n## Here you can define your custom shell\n## arguments, like another rcfile.\n#SOSGIT_SHELLARGS=\n#\n## Make\n## DEFAULT: /bin/make\n#SOSGIT_MAKE=/bin/make\n#\n## Editor\n## DEFAULT: /bin/nano\n## You may want to set this to /bin/vi\n## or /bin/vim or any other editor.\n#SOSGIT_EDITOR=/bin/nano\n#\n## cURL\n## DEFAULT: /bin/curl\n#SOSGIT_CURL=/bin/curl\n#\n## git\n## DEFAULT: /bin/git\n#SOSGIT_GIT=/bin/git\n#\n## ls\n## DEFAULT: /bin/ls\n## The ls command must be from GNU\n## coreutils, otherwise it may not\n## work correctly with sos-git.\n#SOSGIT_LS=/bin/ls\n#\n## rm\n## DEFAULT: /bin/rm\n## The rm command must be from GNU\n## coreutils, otherwise it may not\n## work correctly with sos-git.\n#SOSGIT_RM=/bin/rm\n#\n## mkdir\n## DEFAULT: /bin/mkdir\n## The mkdir command must be from\n## GNU coreutils, otherwise it may\n## not work correctly with sos-git.\n#SOSGIT_MKDIR=/bin/mkdir\n#\n## mv\n## DEFAULT: /bin/mv\n## The mv command must be from GNU\n## coreutils, otherwise it may not\n## work correctly with sos-git.\n#SOSGIT_MV=/bin/mv\n#\n## chmod\n## DEFAULT: /bin/chmod\n## The chmod command must be from\n## GNU coreutils, otherwise it may\n## not work correctly with sos-git.\n#SOSGIT_CHMOD=/bin/chmod\n\n# Title\n## Suppress\n## DEFAULT: false\n## This hides the branding at\n## startup completely.\n#SOSGIT_TITLE_SUPPRESS=false\n#\n## Text\n## DEFAULT: false\n## This prints the branding\n## at startup in normal text.\n#SOSGIT_TITLE_TEXT=false\n\n# Temp\n# DEFAULT: /dev/shm\n# The temporary directory.\n# NO TRAILING SLASH AT THE END!\n#SOSGIT_TMP=/dev/shm\n\n# Repository save directory\n# DEFAULT: \$HOME/.sostools/git/repos\n# The directory where your downloaded\n# repositories are stored.\n# NO TRAILING SLASH AT THE END!\n# NO ~, USE \$HOME INSTEAD!\n#SOSGIT_REPOS=\$HOME/.sostools/git/repos\n\n# Internet\n## Update URL\n## DEFAULT: https://staropensource.ddns.net\n## /git/staropensource/sostools\n## /raw/branch/master/sos-git.sh\n## The update URL, from where sos-git gets\n## updates. The save location will be\n## determined from the command line arguments.\n#SOSGIT_UPDATEURL=https://staropensource.ddns.net/git/staropensource/sostools/raw/branch/master/sos-git.sh\n#\n## Request string\n## DEFAULT: https://staropensource.ddns.net\n## /git/%s/%s\n## String is used for making requests and\n## downloading repositories. First %s is user,\n## second %s is the repository.\n## NO TRAILING SLASH AT THE END!\n#SOSGIT_REQUESTSTRING=https://staropensource.ddns.net/git/%s/%s\n#\n## Remote request string\n## DEFAULT: https://%s:%s@staropensource.ddns.net/%s/%s## String is used for remoteauth, that updates\n## the remote string in git. First %s is username,\n## second %s is password, third %s is user and\n## fourth %s is the repository.\n## NO TRAILING SLASH AT THE END!\n#SOSGIT_REQUESTSTRING_REMOTE=https://%s:%s@staropensource.ddns.net/%s/%s\n# No root warning\n## DEFAULT: false\n## Disables the root warning\n#SOSGIT_NOROOTWARNING=false\n"
|
||||
return "0"
|
||||
}
|
||||
function loadDefaultConfiguration() {
|
||||
export "SOSGIT_CONFIGVERSION=4"
|
||||
export "SOSGIT_CONFIGVERSION=5"
|
||||
export "SOSGIT_SETUP_USER=false"
|
||||
export "SOSGIT_SETUP_SYSTEM=false"
|
||||
export "SOSGIT_SHELL=/bin/sh"
|
||||
|
@ -443,7 +449,7 @@ elif [ "$1" == "shell" ]; then
|
|||
if existRepo "$2"; then
|
||||
translateRepo "$2"
|
||||
cd "$SOSGIT_EXITSTRING"
|
||||
$SOSGIT_SHELL
|
||||
$SOSGIT_SHELL $SOSGIT_SHELLARGS
|
||||
exit "$?"
|
||||
else
|
||||
noRepoFound "$2"
|
||||
|
|
Reference in a new issue