+
Skip to content

Ensure sudo is installed before calling it #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
- checkout
- node/install-packages
- run: npm test
resource_class: large
package:
docker:
- image: cimg/node:16.8.0-browsers
Expand Down
4 changes: 2 additions & 2 deletions src/test/expected/dynamic-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand Down
32 changes: 16 additions & 16 deletions src/test/expected/with-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand Down Expand Up @@ -83,8 +83,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand Down Expand Up @@ -122,8 +122,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand All @@ -147,8 +147,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand All @@ -172,8 +172,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand Down Expand Up @@ -222,8 +222,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand All @@ -250,8 +250,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand All @@ -275,8 +275,8 @@ jobs:
steps:
- run:
name: Ensure volume is writable
command: |-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ]
command: >-
if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) /tmp/local-ci
fi
Expand Down
2 changes: 1 addition & 1 deletion src/utils/writeProcessFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function getEnsureVolumeIsWritableStep() {
return {
run: {
name: 'Ensure volume is writable',
command: `if [ "$(ls -ld ${CONTAINER_STORAGE_DIRECTORY} | awk '{print $3}')" != "$(whoami)" ]
command: `if [ "$(ls -ld ${CONTAINER_STORAGE_DIRECTORY} | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ]
then
sudo chown $(whoami) ${CONTAINER_STORAGE_DIRECTORY}
fi`,
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载