Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fabian.troller
scripts
Commits
c7beb023
Commit
c7beb023
authored
4 years ago
by
dylan.peiry
Browse files
Options
Downloads
Patches
Plain Diff
fix(gitcreate) visibility arg
parent
b1e97bf3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
gitcreate.sh
+9
-3
9 additions, 3 deletions
gitcreate.sh
with
9 additions
and
3 deletions
gitcreate.sh
+
9
−
3
View file @
c7beb023
...
...
@@ -25,9 +25,15 @@ fi
# The name of the repository will be the name of the current directory
NAME
=
$(
basename
$PWD
)
USERNAME
=
$1
VISIBILITY
=
$2
PUBLIC
=
$2
ACCESS_METHOD
=
$3
echo
$ACCESS_METHOD
VISIBILITY
=
""
if
[[
$PUBLIC
==
"true"
]]
;
then
VISIBILITY
=
"public"
else
VISIBILITY
=
"private"
fi
# Define the remote origin (url on which we will link the local repository)
REMOTE_ORIGIN
=
""
...
...
@@ -41,7 +47,7 @@ echo $REMOTE_ORIGIN
# Call the api to create the repository with the specified name
RESPONSE
=
$(
curl
-X
POST
'https://gitedu.hesge.ch/api/v4/projects?private_token='
$ACCESS_TOKEN
''
\
-d
'{"name":"'
$NAME
'","path":"'
$NAME
'"}'
\
-d
'{"name":"'
$NAME
'","path":"'
$NAME
'"
,"visibility":"'
$VISIBILITY
'"
}'
\
-H
"Content-Type: application/json"
\
-silent
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment