summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
Diffstat (limited to 'src/init')
-rwxr-xr-xsrc/init14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/init b/src/init
index 3686332..4c7e979 100755
--- a/src/init
+++ b/src/init
@@ -54,7 +54,7 @@ end
function setupRepo
set -l repoConfig $argv[1]
- set -l parsedConfig (string split ':' -- $repoConfig)
+ set -l parsedConfig (string split ';' -- $repoConfig)
set -l repo $parsedConfig[1]
# check repo name
@@ -70,8 +70,16 @@ function setupRepo
echo "Setting up repo: $repo"
# write user as allowed into permission file
- for user in $parsedConfig[2..]
- echo "$repoDir:$user" >> $_REPO_PERMISSIONS_FILE
+ for userConfig in $parsedConfig[2..]
+ set -l parsedConfig (string split ':' -- $userConfig)
+ set -l user $parsedConfig[1]
+ set -l permission $parsedConfig[2]
+
+ # check for valid permission
+ if not contains $permission $_PERMISSIONS
+ set permission "r"
+ end
+ echo "$repoDir:$user:$permission" >> $_REPO_PERMISSIONS_FILE
end
# setup repo dir