Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoInstaller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External 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
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
Dojo Project (HES-SO)
Projects
UI
DojoInstaller
Commits
81b78e7a
Verified
Commit
81b78e7a
authored
10 months ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
added creation of /home/orestis/.local/bin directory if not existing
parent
9af0a3ae
Branches
create_local_bin
No related tags found
1 merge request
!1
Adds creation of $HOME/.local/bin directory if not existing
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
installer.sh
+143
-137
143 additions, 137 deletions
installer.sh
with
143 additions
and
137 deletions
installer.sh
+
143
−
137
View file @
81b78e7a
...
@@ -3,13 +3,18 @@
...
@@ -3,13 +3,18 @@
#
#
# Distributed under terms of the GPLv3 license.
# Distributed under terms of the GPLv3 license.
{
\u
nalias
command
;
\u
nset
-f
command
;
}
>
/dev/null 2>&1
{
\u
nalias
command
\u
nset
-f
command
}
>
/dev/null 2>&1
tdir
=
''
tdir
=
''
gitedu_release_url
=
"https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest"
gitedu_release_url
=
"https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest"
gitedu_prealpha_url
=
"https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest"
gitedu_prealpha_url
=
"https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest"
gitedu_url
=
$gitedu_release_url
gitedu_url
=
$gitedu_release_url
cleanup_success
()
{
cleanup_success
()
{
printf
"The dojo is installed in %s
\n
Make sure %s is in your path
\n
"
"
$dest
"
"
$dest
"
printf
"The dojo is installed in %s
\n
Make sure %s is in your path
\n
"
"
$dest
"
"
$destdir
"
printf
"If you are using bash you may want to append:
\n
"
printf
"export PATH=
\"\$
PATH:%s
\"
to your .bashrc file.
\n
"
"
$destdir
"
cleanup
cleanup
}
}
...
@@ -23,8 +28,8 @@ cleanup() {
...
@@ -23,8 +28,8 @@ cleanup() {
die
()
{
die
()
{
cleanup
cleanup
printf
"
\0
33[31m%s
\0
33[m
\n\r
"
"
$*
"
>
/dev/stderr
;
printf
"
\0
33[31m%s
\0
33[m
\n\r
"
"
$*
"
>
/dev/stderr
exit
1
;
exit
1
}
}
detect_jq_tool
()
{
detect_jq_tool
()
{
...
@@ -37,7 +42,6 @@ detect_jq_tool() {
...
@@ -37,7 +42,6 @@ detect_jq_tool() {
fi
fi
}
}
detect_network_tool
()
{
detect_network_tool
()
{
if
command
-v
curl 2>/dev/null
>
/dev/null
;
then
if
command
-v
curl 2>/dev/null
>
/dev/null
;
then
fetch
()
{
fetch
()
{
...
@@ -72,11 +76,11 @@ detect_network_tool() {
...
@@ -72,11 +76,11 @@ detect_network_tool() {
fi
fi
}
}
detect_os
()
{
detect_os
()
{
arch
=
""
arch
=
""
case
"
$(
command uname
)
"
in
case
"
$(
command uname
)
"
in
'Darwin'
)
OS
=
"macos"
'Darwin'
)
OS
=
"macos"
case
"
$(
command uname
-m
)
"
in
case
"
$(
command uname
-m
)
"
in
amd64
|
x86_64
)
arch
=
"x64"
;;
amd64
|
x86_64
)
arch
=
"x64"
;;
aarch64
*
)
arch
=
"arm64"
;;
aarch64
*
)
arch
=
"arm64"
;;
...
@@ -95,7 +99,7 @@ detect_os() {
...
@@ -95,7 +99,7 @@ detect_os() {
*
)
die
"dojo binaries are not available for
$(
command uname
-m
)
architecture. See
$gitedu_url
to download manually"
;;
*
)
die
"dojo binaries are not available for
$(
command uname
-m
)
architecture. See
$gitedu_url
to download manually"
;;
esac
esac
;;
;;
*
)
die
"dojo binaries are not available for
$(
command uname
)
. See
$gitedu_url
to download manually"
*
)
die
"dojo binaries are not available for
$(
command uname
)
. See
$gitedu_url
to download manually"
;;
esac
esac
}
}
...
@@ -106,23 +110,26 @@ expand_tilde() {
...
@@ -106,23 +110,26 @@ expand_tilde() {
}
}
parse_args
()
{
parse_args
()
{
dest
=
'~/.local/bin'
dest
dir
=
'~/.local/bin'
[
"
$OS
"
=
"macos"
]
&&
dest
=
"/usr/local/bin"
[
"
$OS
"
=
"macos"
]
&&
dest
dir
=
"/usr/local/bin"
installer
=
''
installer
=
''
while
:
;
do
while
:
;
do
case
"
$1
"
in
case
"
$1
"
in
dest
=
*
)
dest
=
"
${
1
#*=
}
"
;;
dest
dir
=
*
)
dest
dir
=
"
${
1
#*=
}
"
;;
installer
=
*
)
installer
=
"
${
1
#*=
}
"
;;
installer
=
*
)
installer
=
"
${
1
#*=
}
"
;;
""
)
break
;;
""
)
break
;;
*
)
die
"Unrecognized command line option:
$1
"
;;
*
)
die
"Unrecognized command line option:
$1
"
;;
esac
esac
shift
shift
done
done
dest
=
$(
expand_tilde
"
${
dest
}
"
)
destdir
=
$(
expand_tilde
"
${
destdir
}
"
)
dest
=
"
$dest
/dojo"
if
[
!
-d
"
$destdir
"
]
;
then
printf
"Directory %s does not exist. Creatring %s now.
\n
"
"
$destdir
"
"
$destdir
"
mkdir
-p
"
$destdir
"
fi
dest
=
"
$destdir
/dojo"
}
}
get_file_url
()
{
get_file_url
()
{
url
=
"https://gitedu.hesge.ch/api/v4/projects/12972/packages/generic/dojo"
url
=
"https://gitedu.hesge.ch/api/v4/projects/12972/packages/generic/dojo"
if
[
"
$OS
"
=
"macos"
]
;
then
if
[
"
$OS
"
=
"macos"
]
;
then
...
@@ -138,7 +145,6 @@ get_release_url() {
...
@@ -138,7 +145,6 @@ get_release_url() {
get_file_url
"
$release_version
"
get_file_url
"
$release_version
"
}
}
get_prealpha_url
()
{
get_prealpha_url
()
{
gitedu_url
=
$gitedu_prealpha_url
gitedu_url
=
$gitedu_prealpha_url
prealpha_version
=
$(
fetch_and_get_version_quiet https://gitedu.hesge.ch/api/v4/projects/12972/releases/Pre-alpha
)
prealpha_version
=
$(
fetch_and_get_version_quiet https://gitedu.hesge.ch/api/v4/projects/12972/releases/Pre-alpha
)
...
...
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