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
4c654e4e
Commit
4c654e4e
authored
5 years ago
by
Simon Oehrl
Browse files
Options
Downloads
Patches
Plain Diff
Fix plugin selection
parent
d16ee4fa
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
setup.sh
+163
-5
163 additions, 5 deletions
setup.sh
with
163 additions
and
5 deletions
setup.sh
+
163
−
5
View file @
4c654e4e
...
...
@@ -44,13 +44,169 @@ function initial_setup() {
fi
echo
"Done!"
else
echo
"Skipping setup. Press enter to continue"
read
temp
echo
"Skipping setup."
fi
}
function
manage_plugins
()
{
echo
"Hello!"
plugins
=(
"likert scale plugin"
"Logging Plugin"
"nDisplayExtensions"
"NDisplay Launch Button"
"UniversalLogging"
"Unreal Cave Overlay"
"Unreal-Study-Framework"
"Unreal VA Plugin"
"UnrealVisPlugin"
"Widget Interaction Plugin"
)
plugin_repositories
=(
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/likert-scale-plugin.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/logging-plugin.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/ndisplayextensions.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/NDisplayLaunchButton.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/universallogging.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unreal-cave-overlay.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unreal-study-framework.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unreal-va-plugin.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unrealvisplugin.git"
"https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/widgetinteraction.git"
)
if
[
"
$1
"
==
"initial_setup"
]
then
plugin_branches
=(
""
""
"master"
""
""
"master"
""
""
""
""
)
else
plugin_branches
=(
""
""
""
""
""
""
""
""
""
""
)
for
i
in
${
!plugins[@]
}
do
repo_name_with_extension
=
${
plugin_repositories
[
$i
]##*/
}
repo_name
=
${
repo_name_with_extension
%*.git
}
path
=
$(
git config
-f
.gitmodules
--get
"submodule.Plugins/
${
repo_name
}
.path"
)
if
[
$?
==
0
]
then
branch
=
$(
git config
-f
.gitmodules
--get
"submodule.Plugins/
${
repo_name
}
.branch"
)
if
[
$?
-ne
0
]
then
plugin_branches[
$i
]=
"master"
else
plugin_branches[
$i
]=
"
$branch
"
fi
fi
done
fi
function
toggle_branch
()
{
case
${
plugin_branches
[
$1
]
}
in
""
)
plugin_branches[
$1
]=
"master"
;;
"master"
)
plugin_branches[
$1
]=
"develop"
;;
"develop"
)
plugin_branches[
$1
]=
""
;;
*
)
>
&2
;
plugin_branches[
$1
]=
""
;;
esac
}
selection
=
0
exit
=
false
cancel
=
false
num_plugins_minus_one
=
${#
plugins
[@]
}
let
num_plugins_minus_one-
=
1
while
[
$exit
==
"false"
]
do
clear
echo
"Select plugins to install:"
echo
""
for
i
in
${
!plugins[@]
}
do
if
[
$i
==
$selection
]
then
printf
"
\e
[7m"
fi
if
[
-z
${
plugin_branches
[
$i
]
}
]
then
echo
" [ ]
${
plugins
[
$i
]
}
"
else
echo
" [X]
${
plugins
[
$i
]
}
:
${
plugin_branches
[
$i
]
}
"
fi
if
[
$i
==
$selection
]
then
printf
"
\e
[0m"
fi
done
echo
""
echo
"[Arrow Up/Down] Select Plugin"
echo
"[Space] Toggle branch"
echo
"[Enter] Continue"
echo
"[Esc] Cancel"
IFS
=
''
escape_char
=
$(
printf
"
\u
1b"
)
escape
=
false
read
-rsn1
mode
# get 1 character
if
[[
$mode
==
$escape_char
]]
;
then
escape
=
true
read
-rsn2
-t
0.1 mode
# read 2 more chars
fi
case
$mode
in
""
)
if
[
"
$escape
"
==
true
]
;
then
cancel
=
true
;
fi
;
exit
=
true
;;
" "
)
toggle_branch
$selection
;;
"[A"
)
if
[
"
$selection
"
-gt
"0"
]
;
then
let
selection-
=
1
;
fi
;;
"[B"
)
if
[
"
$selection
"
-lt
"
$num_plugins_minus_one
"
]
;
then
let
selection+
=
1
;
fi
;;
*
)
>
&2
;;
esac
done
if
[
"
$cancel
"
!=
true
]
then
clear
mkdir
-p
Plugins
cd
Plugins
echo
"Adding plugins..."
for
i
in
${
!plugins[@]
}
do
if
[
-n
"
${
plugin_branches
[
$i
]
}
"
]
then
echo
"
${
plugins
[
$i
]
}
"
git submodule add
-b
${
plugin_branches
[
$i
]
}
${
plugin_repositories
[
$i
]
}
fi
done
cd
..
fi
}
function
show_main_menu
()
{
...
...
@@ -62,8 +218,6 @@ function show_main_menu() {
clear
echo
"Select Task:"
echo
"[Arrow Up/Down] Change Selection"
echo
"[Enter] Select"
echo
""
items
=(
"InitialSetup"
"ManagePlugins"
"Exit"
)
...
...
@@ -85,6 +239,10 @@ function show_main_menu() {
fi
done
echo
""
echo
"[Arrow Up/Down] Change Selection"
echo
"[Enter] Select"
IFS
=
''
escape_char
=
$(
printf
"
\u
1b"
)
read
-rsn1
mode
# get 1 character
...
...
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