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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fabian.troller
scripts
Commits
b110ba12
Commit
b110ba12
authored
4 years ago
by
poulpe
Browse files
Options
Downloads
Patches
Plain Diff
[Features + Bug] Add global variable for color + Fix error for .gitignore by overwrite file
parent
fc3cd2aa
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
+15
-9
15 additions, 9 deletions
gitcreate.sh
with
15 additions
and
9 deletions
gitcreate.sh
+
15
−
9
View file @
b110ba12
...
@@ -8,11 +8,17 @@ ACCESS_TOKEN=""
...
@@ -8,11 +8,17 @@ ACCESS_TOKEN=""
HTTPS
=
"https://gitedu.hesge.ch"
HTTPS
=
"https://gitedu.hesge.ch"
SSH
=
"ssh://git@ssh.hesge.ch:10572"
SSH
=
"ssh://git@ssh.hesge.ch:10572"
# Add global var for color
GREEN
=
"
\e
[32m"
RESET
=
"
\e
[0m"
BROWN
=
"
\e
[33m"
RED
=
"
\e
[31m"
# messages
# messages
GITIGNORE_GENERATED
=
"
\e
[32m
.gitignore generated.
\e
[0m
"
GITIGNORE_GENERATED
=
"
${
GREEN
}
.gitignore generated.
${
RESET
}
"
REPOSITORY_NAME_TAKEN
=
"
\e
[33m
A repository with this name already exists.
\e
[0m
"
REPOSITORY_NAME_TAKEN
=
"
${
BROWN
}
A repository with this name already exists.
${
RESET
}
"
ARGUMENTS_MISSING
=
"
\e
[31m
Arguments are missing.
\e
[0m
"
ARGUMENTS_MISSING
=
"
${
RED
}
Arguments are missing.
${
RESET
}
"
REPOSITORY_CREATED
=
"
\e
[32m
The repository is now created with the files of the current folder pushed to it.
\e
[0m
"
REPOSITORY_CREATED
=
"
${
GREEN
}
The repository is now created with the files of the current folder pushed to it.
${
RESET
}
"
# Display the usage of the script
# Display the usage of the script
function
d_usage
{
function
d_usage
{
...
@@ -43,7 +49,7 @@ do
...
@@ -43,7 +49,7 @@ do
p
)
PUBLIC
=
${
OPTARG
}
;;
p
)
PUBLIC
=
${
OPTARG
}
;;
m
)
METHOD
=
${
OPTARG
}
;;
m
)
METHOD
=
${
OPTARG
}
;;
\?
)
\?
)
echo
-e
"
\e
[31m
-
${
OPTARG
}
is not a valid option.
\e
[0m
"
echo
-e
"
${
RED
}
-
${
OPTARG
}
is not a valid option.
${
RESET
}
"
d_usage
d_usage
exit
;;
exit
;;
esac
esac
...
@@ -89,9 +95,9 @@ fi
...
@@ -89,9 +95,9 @@ fi
# Create a .gitignore specific to a c program
# Create a .gitignore specific to a c program
touch
.gitignore
touch
.gitignore
echo
"*"
>
.gitignore
echo
"*"
>
.gitignore
echo
"!*.*"
>
.gitignore
echo
"!*.*"
>
>
.gitignore
echo
"!Makefile"
>
.gitignore
echo
"!Makefile"
>
>
.gitignore
echo
"*.o"
>
.gitignore
echo
"*.o"
>
>
.gitignore
# Initialize a local repository and push the files
# Initialize a local repository and push the files
...
...
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