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
937fed8d
Commit
937fed8d
authored
5 years ago
by
Simon Oehrl
Browse files
Options
Downloads
Patches
Plain Diff
Add preset selection step
parent
ee15449b
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
+100
-8
100 additions, 8 deletions
setup.sh
with
100 additions
and
8 deletions
setup.sh
+
100
−
8
View file @
937fed8d
...
...
@@ -70,9 +70,24 @@ function manage_plugins() {
SAVEIFS
=
$IFS
IFS
=
$'
\n
'
preset_list
=(
$(
git config
-f
Plugins/unrealplugins/presets.config
--name-only
--get-regexp
".*.name"
)
)
plugin_list
=(
$(
git config
-f
Plugins/unrealplugins/plugins.config
--name-only
--get-regexp
".*.name"
)
)
IFS
=
$SAVEIFS
declare
-a
preset_ids
declare
-a
preset_descriptions
declare
-a
presets
for
i
in
${
!preset_list[@]
}
do
preset_id
=
${
preset_list
[
$i
]%.name
}
preset_ids+
=(
"
$preset_id
"
)
preset_name
=
$(
git config
-f
Plugins/unrealplugins/presets.config
--get
"
$preset_id
.name"
)
presets+
=(
"
${
preset_name
}
"
)
preset_description
=
$(
git config
-f
Plugins/unrealplugins/presets.config
--get
"
$preset_id
.description"
)
preset_descriptions+
=(
"
${
preset_description
}
"
)
done
declare
-a
plugin_ids
declare
-a
plugins
declare
-a
plugin_repositories
...
...
@@ -88,13 +103,7 @@ function manage_plugins() {
if
[
"
$1
"
==
"initial_setup"
]
then
branch
=(
$(
git config
-f
Plugins/unrealplugins/plugins.config
--get
"
$plugin_id
.default-branch"
)
)
if
[
$?
==
0
]
then
plugin_branches+
=(
"
$branch
"
)
else
plugin_branches+
=(
""
)
fi
else
path
=
$(
git config
-f
.gitmodules
--get
"submodule.Plugins/
${
plugin_id
}
.path"
)
if
[
$?
==
0
]
...
...
@@ -112,6 +121,89 @@ function manage_plugins() {
fi
done
if
[
"
$1
"
==
"initial_setup"
]
then
selection
=
0
exit
=
false
cancel
=
false
num_presets_minus_one
=
${#
presets
[@]
}
let
num_presets_minus_one-
=
1
while
[
$exit
==
"false"
]
do
clear
echo
"Select plugin preset:"
echo
""
for
i
in
${
!presets[@]
}
do
if
[
$i
==
$selection
]
then
printf
"
\e
[7m"
fi
echo
"
${
presets
[
$i
]
}
"
if
[
$i
==
$selection
]
then
printf
"
\e
[0m"
fi
done
echo
""
echo
"
${
preset
[
$selection
]
}
"
echo
"
${
preset_descriptions
[
$selection
]
}
"
echo
""
echo
"[Arrow Up/Down] Select preset"
echo
"[Enter] Continue"
echo
"[Esc] Skip preset selection"
SAVEIFS
=
$IFS
IFS
=
''
escape_char
=
$(
printf
"
\0
33"
)
escape
=
false
read
-rsn1
mode
# get 1 character
if
[[
$mode
==
$escape_char
]]
;
then
escape
=
true
read
-rsn2
mode
# read 2 more chars
fi
IFS
=
$SAVEIFS
case
$mode
in
""
)
if
[
"
$escape
"
==
true
]
;
then
cancel
=
true
;
fi
;
exit
=
true
;;
"[D"
)
previous_branch
$selection
;;
"[C"
)
next_branch
$selection
;;
"[A"
)
if
[
"
$selection
"
-gt
"0"
]
;
then
let
selection-
=
1
;
fi
;;
"[B"
)
if
[
"
$selection
"
-lt
"
$num_presets_minus_one
"
]
;
then
let
selection+
=
1
;
fi
;;
*
)
>
&2
;;
esac
done
# Set the appropriate plugin branches
if
[
"
$cancel
"
!=
true
]
then
SAVEIFS
=
$IFS
IFS
=
$'
\n
'
preset_plugins
=(
$(
git config
-f
Plugins/unrealplugins/presets.config
--name-only
--get-regexp
"
${
preset_ids
[
$selection
]
}
\.
plugins
\.
.*"
)
)
IFS
=
$SAVEIFS
for
plugin
in
${
preset_plugins
[@]
}
do
plugin_id
=
${
plugin
#
"
${
preset_ids
[
$selection
]
}
.plugins."
}
for
i
in
${
!plugins[@]
}
do
if
[
$plugin_id
==
${
plugin_ids
[
$i
]
}
]
then
branch
=
$(
git config
-f
Plugins/unrealplugins/presets.config
--get
"
$plugin
"
)
plugin_branches[
$i
]=
$branch
fi
done
done
fi
fi
function
next_branch
()
{
case
${
plugin_branches
[
$1
]
}
in
""
)
plugin_branches[
$1
]=
"master"
;;
...
...
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