Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tiled Display Video
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Tiled Display Video
Commits
d16ee4fa
Commit
d16ee4fa
authored
5 years ago
by
Simon Oehrl
Browse files
Options
Downloads
Patches
Plain Diff
Add main menu
parent
973353ce
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.sh
+100
-47
100 additions, 47 deletions
setup.sh
with
100 additions
and
47 deletions
setup.sh
+
100
−
47
View file @
d16ee4fa
#!/bin/sh
#!/bin/sh
if
[
!
-f
"update.txt"
]
function
initial_setup
()
{
then
clear
remote_branch
=
$(
git rev-parse
--abbrev-ref
@
{
u
}
)
if
[[
"
$remote_branch
"
!=
"origin/"
*
]]
echo
"The setup will now delete all branches and remotes and create a default develop and master branch. Continue? [Y/n]"
read
cont
if
[
$cont
==
"y"
]
||
[
$cont
==
"Y"
]
||
[
$cont
==
""
]
then
then
echo
"This script can only handle remotes named origin!"
exit
-1
fi
remote_branch
=
${
remote_branch
#
"origin/"
}
repository_url
=
$(
git remote get-url origin
)
echo
"
$repository_url
"
echo
"
$repository_url
"
>>
update.txt
echo
"
$remote_branch
"
>>
update.txt
fi
current_branch
=
$(
git rev-parse
--abbrev-ref
HEAD
)
current_branch
=
$(
git rev-parse
--abbrev-ref
HEAD
)
branches_to_delete
=
$(
git
for
-each-ref
--format
=
'%(refname:short)'
refs/heads/
)
branches_to_delete
=
$(
git
for
-each-ref
--format
=
'%(refname:short)'
refs/heads/
)
...
@@ -36,11 +24,12 @@ then
...
@@ -36,11 +24,12 @@ then
git branch
-d
"
$current_branch
"
git branch
-d
"
$current_branch
"
fi
fi
git remote remove origin
git add
.
git add
.
git commit
-m
"Initial commit"
git commit
-m
"Initial commit"
git branch master
git branch master
git remote | xargs
-n1
git remote remove
echo
"Enter URL of the project's git repository (Leave empty to skip this step):"
echo
"Enter URL of the project's git repository (Leave empty to skip this step):"
read
new_remote
read
new_remote
...
@@ -53,5 +42,69 @@ then
...
@@ -53,5 +42,69 @@ then
git push
-u
origin master
git push
-u
origin master
git checkout develop
git checkout develop
fi
fi
echo
"Done!"
echo
"Done!"
else
echo
"Skipping setup. Press enter to continue"
read
temp
fi
}
function
manage_plugins
()
{
echo
"Hello!"
}
function
show_main_menu
()
{
selection
=
0
exit
=
false
while
[
$exit
=
false
]
do
clear
echo
"Select Task:"
echo
"[Arrow Up/Down] Change Selection"
echo
"[Enter] Select"
echo
""
items
=(
"InitialSetup"
"ManagePlugins"
"Exit"
)
for
i
in
${
!items[@]
}
do
if
[
$i
==
$selection
]
then
printf
"
\e
[7m* "
else
printf
" "
fi
echo
"
${
items
[
$i
]
}
"
if
[
$i
==
$selection
]
then
printf
"
\e
[0m"
fi
done
IFS
=
''
escape_char
=
$(
printf
"
\u
1b"
)
read
-rsn1
mode
# get 1 character
if
[[
$mode
==
$escape_char
]]
;
then
read
-rsn2
mode
# read 2 more chars
fi
case
$mode
in
""
)
exit
=
true
;;
"[A"
)
if
[
"
$selection
"
-gt
"0"
]
;
then
let
selection-
=
1
;
fi
;;
"[B"
)
if
[
"
$selection
"
-lt
"3"
]
;
then
let
selection+
=
1
;
fi
;;
*
)
>
&2
;;
esac
done
case
$selection
in
0
)
initial_setup
;
show_main_menu
;;
1
)
manage_plugins
;
show_main_menu
;;
2
)
;;
*
)
>
&2
;;
esac
}
show_main_menu
\ No newline at end of file
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