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
78ef2cce
Unverified
Commit
78ef2cce
authored
Jun 13, 2022
by
Samruddhi Khandale
Committed by
GitHub
Jun 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Common: Handle meta.env for devcontainer-info cmd (#46)
Handle meta.env
parent
fa07406f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
install.sh
src/common/install.sh
+12
-10
No files found.
src/common/install.sh
View file @
78ef2cce
...
@@ -17,8 +17,9 @@ USER_UID=${USER_UID:-"automatic"}
...
@@ -17,8 +17,9 @@ USER_UID=${USER_UID:-"automatic"}
USER_GID
=
${
USER_GID
:-
"automatic"
}
USER_GID
=
${
USER_GID
:-
"automatic"
}
ADD_NON_FREE_PACKAGES
=
${
ADD_NON_FREE_PACKAGES
:-
"false"
}
ADD_NON_FREE_PACKAGES
=
${
ADD_NON_FREE_PACKAGES
:-
"false"
}
SCRIPT_DIR
=
"
$(
cd
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
&&
pwd
)
"
DEV_CONTAINERS_DIR
=
"/usr/local/etc/vscode-dev-containers"
MARKER_FILE
=
"/usr/local/etc/vscode-dev-containers/common"
MARKER_FILE
=
"
${
DEV_CONTAINERS_DIR
}
/common"
if
[
"
$(
id
-u
)
"
-ne
0
]
;
then
if
[
"
$(
id
-u
)
"
-ne
0
]
;
then
echo
-e
'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
echo
-e
'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
...
@@ -237,8 +238,8 @@ if [[ "${PATH}" != *"$HOME/.local/bin"* ]]; then export PATH="${PATH}:$HOME/.loc
...
@@ -237,8 +238,8 @@ if [[ "${PATH}" != *"$HOME/.local/bin"* ]]; then export PATH="${PATH}:$HOME/.loc
# Display optional first run image specific notice if configured and terminal is interactive
# Display optional first run image specific notice if configured and terminal is interactive
if [ -t 1 ] && [[ "
${
TERM_PROGRAM
}
" = "vscode" || "
${
TERM_PROGRAM
}
" = "codespaces" ]] && [ ! -f "
$HOME
/.config/vscode-dev-containers/first-run-notice-already-displayed" ]; then
if [ -t 1 ] && [[ "
${
TERM_PROGRAM
}
" = "vscode" || "
${
TERM_PROGRAM
}
" = "codespaces" ]] && [ ! -f "
$HOME
/.config/vscode-dev-containers/first-run-notice-already-displayed" ]; then
if [ -f "
/usr/local/etc/vscode-dev-containers
/first-run-notice.txt" ]; then
if [ -f "
${
DEV_CONTAINERS_DIR
}
/first-run-notice.txt" ]; then
cat "
/usr/local/etc/vscode-dev-containers
/first-run-notice.txt"
cat "
${
DEV_CONTAINERS_DIR
}
/first-run-notice.txt"
elif [ -f "/workspaces/.codespaces/shared/first-run-notice.txt" ]; then
elif [ -f "/workspaces/.codespaces/shared/first-run-notice.txt" ]; then
cat "/workspaces/.codespaces/shared/first-run-notice.txt"
cat "/workspaces/.codespaces/shared/first-run-notice.txt"
fi
fi
...
@@ -435,15 +436,16 @@ if [ ! -z "${CONTENTS_URL}" ]; then echo && echo "More info: ${CONTENTS_URL}"; f
...
@@ -435,15 +436,16 @@ if [ ! -z "${CONTENTS_URL}" ]; then echo && echo "More info: ${CONTENTS_URL}"; f
echo
echo
EOF
EOF
)
"
)
"
if
[
-f
"
${
SCRIPT_DIR
}
/meta.env"
]
;
then
if
[
-f
"
${
DEV_CONTAINERS_DIR
}
/meta.env"
]
;
then
mkdir
-p
/usr/local/etc/vscode-dev-containers/
cp
-f
"
${
SCRIPT_DIR
}
/meta.env"
/usr/local/etc/vscode-dev-containers/meta.env
echo
"
${
meta_info_script
}
"
>
/usr/local/bin/devcontainer-info
echo
"
${
meta_info_script
}
"
>
/usr/local/bin/devcontainer-info
chmod
+x /usr/local/bin/devcontainer-info
chmod
+x /usr/local/bin/devcontainer-info
fi
fi
if
[
!
-d
"
${
DEV_CONTAINERS_DIR
}
"
]
;
then
mkdir
-p
"
$(
dirname
"
${
MARKER_FILE
}
"
)
"
fi
# Write marker file
# Write marker file
mkdir
-p
"
$(
dirname
"
${
MARKER_FILE
}
"
)
"
echo
-e
"
\
echo
-e
"
\
PACKAGES_ALREADY_INSTALLED=
${
PACKAGES_ALREADY_INSTALLED
}
\n\
PACKAGES_ALREADY_INSTALLED=
${
PACKAGES_ALREADY_INSTALLED
}
\n\
LOCALE_ALREADY_SET=
${
LOCALE_ALREADY_SET
}
\n\
LOCALE_ALREADY_SET=
${
LOCALE_ALREADY_SET
}
\n\
...
@@ -452,7 +454,7 @@ echo -e "\
...
@@ -452,7 +454,7 @@ echo -e "\
ZSH_ALREADY_INSTALLED=
${
ZSH_ALREADY_INSTALLED
}
"
>
"
${
MARKER_FILE
}
"
ZSH_ALREADY_INSTALLED=
${
ZSH_ALREADY_INSTALLED
}
"
>
"
${
MARKER_FILE
}
"
# Display a notice on conda when not running in GitHub Codespaces
# Display a notice on conda when not running in GitHub Codespaces
cat
<<
'
EOF
' >
/usr/local/etc/vscode-dev-containers
/conda-notice.txt
cat
<<
'
EOF
' >
${
DEV_CONTAINERS_DIR
}
/conda-notice.txt
When using "conda" from outside of GitHub Codespaces, note the Anaconda repository contains
When using "conda" from outside of GitHub Codespaces, note the Anaconda repository contains
restrictions on commercial use that may impact certain organizations. See https://aka.ms/ghcs-conda
restrictions on commercial use that may impact certain organizations. See https://aka.ms/ghcs-conda
...
@@ -460,7 +462,7 @@ EOF
...
@@ -460,7 +462,7 @@ EOF
notice_script
=
"
$(
cat
<<
'
EOF
'
notice_script
=
"
$(
cat
<<
'
EOF
'
if [ -t 1 ] && [ "
${
IGNORE_NOTICE
}
" != "true" ] && [ "
${
TERM_PROGRAM
}
" = "vscode" ] && [ "
${
CODESPACES
}
" != "true" ] && [ ! -f "
$HOME
/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then
if [ -t 1 ] && [ "
${
IGNORE_NOTICE
}
" != "true" ] && [ "
${
TERM_PROGRAM
}
" = "vscode" ] && [ "
${
CODESPACES
}
" != "true" ] && [ ! -f "
$HOME
/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then
cat "
/usr/local/etc/vscode-dev-containers
/conda-notice.txt"
cat "
${
DEV_CONTAINERS_DIR
}
/conda-notice.txt"
mkdir -p "
$HOME
/.config/vscode-dev-containers"
mkdir -p "
$HOME
/.config/vscode-dev-containers"
((sleep 10s; touch "
$HOME
/.config/vscode-dev-containers/conda-notice-already-displayed") &)
((sleep 10s; touch "
$HOME
/.config/vscode-dev-containers/conda-notice-already-displayed") &)
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