Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazydevelop-devcontainer-temp
devcontainer-features
Commits
a71a2235
Unverified
Commit
a71a2235
authored
Jun 10, 2022
by
Samruddhi Khandale
Committed by
GitHub
Jun 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ruby: fix permissions and ln for oryx (#43)
* ruby: fix permissions and ln for oryx * add sudo_if
parent
a81ff33f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
install.sh
src/ruby/install.sh
+13
-1
No files found.
src/ruby/install.sh
View file @
a71a2235
...
@@ -167,6 +167,14 @@ check_packages() {
...
@@ -167,6 +167,14 @@ check_packages() {
fi
fi
}
}
sudo_if
()
{
COMMAND
=
"
$*
"
if
[
"
$(
id
-u
)
"
-eq
0
]
&&
[
"
$USERNAME
"
!=
"root"
]
;
then
su -
"
$USERNAME
"
-c
"
$COMMAND
"
else
"
$COMMAND
"
fi
}
# Ensure apt is in non-interactive to avoid prompts
# Ensure apt is in non-interactive to avoid prompts
export
DEBIAN_FRONTEND
=
noninteractive
export
DEBIAN_FRONTEND
=
noninteractive
...
@@ -271,11 +279,15 @@ if [ "${SKIP_RBENV_RBUILD}" != "true" ]; then
...
@@ -271,11 +279,15 @@ if [ "${SKIP_RBENV_RBUILD}" != "true" ]; then
if
[
"
${
USERNAME
}
"
!=
"root"
]
;
then
if
[
"
${
USERNAME
}
"
!=
"root"
]
;
then
mkdir
-p
/home/
${
USERNAME
}
/.rbenv/plugins
mkdir
-p
/home/
${
USERNAME
}
/.rbenv/plugins
chown
-R
${
USERNAME
}
/home/
${
USERNAME
}
/.rbenv
sudo_if
chown
-R
${
USERNAME
}
/home/
${
USERNAME
}
/.rbenv
sudo_if
chown
-R
${
USERNAME
}
/usr/local/rvm/
if
[[
!
-d
"/home/
${
USERNAME
}
/.rbenv/plugins/ruby-build"
]]
;
then
if
[[
!
-d
"/home/
${
USERNAME
}
/.rbenv/plugins/ruby-build"
]]
;
then
ln
-s
/usr/local/share/ruby-build /home/
${
USERNAME
}
/.rbenv/plugins/ruby-build
ln
-s
/usr/local/share/ruby-build /home/
${
USERNAME
}
/.rbenv/plugins/ruby-build
fi
fi
ln
-s
/usr/local/rvm/rubies/default/bin/ruby /usr/local/rvm/gems/default/bin
fi
fi
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment