Skip to content

Commit 3fc16d8

Browse files
authored
Merge branch 'main' into rongxin-patch-1
2 parents d90fe77 + 14d34fa commit 3fc16d8

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ jobs:
33
deploy:
44
runs-on: ubuntu-latest
55
steps:
6-
- uses: actions/checkout@v3
7-
- uses: actions/setup-python@v4
6+
- uses: actions/checkout@v4
7+
- uses: actions/setup-python@v5
88
with:
99
python-version: '3.10'
1010

@@ -36,7 +36,7 @@ jobs:
3636
3737
- name: Create Release
3838
if: ${{ github.ref == 'refs/heads/main' }}
39-
uses: actions/github-script@v6
39+
uses: actions/github-script@v7
4040
with:
4141
github-token: ${{ github.token }}
4242
script: |

cli50/__main__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def main():
206206
# Options
207207
workdir = "/mnt"
208208
options = ["--detach",
209+
"--env", f"LOCAL_WORKSPACE_FOLDER={directory}",
209210
"--env", f"TZ={tzlocal.get_localzone_name()}",
210211
"--env", f"WORKDIR={workdir}",
211212
"--interactive",
@@ -214,6 +215,7 @@ def main():
214215
"--security-opt", "seccomp=unconfined", # https://stackoverflow.com/q/35860527#comment62818827_35860527, https://github.com/apple/swift-docker/issues/9#issuecomment-328218803
215216
"--tty",
216217
"--volume", directory + ":" + workdir,
218+
"--volume", "/var/run/docker.sock:/var/run/docker-host.sock", # https://github.com/devcontainers/features/blob/main/src/docker-outside-of-docker/devcontainer-feature.json
217219
"--workdir", workdir]
218220

219221
# Check for locale
@@ -260,6 +262,13 @@ def main():
260262
["--publish-all"] +
261263
[f"{IMAGE}:{args['tag']}"] + cmd).decode("utf-8").rstrip()
262264

265+
# Start Docker-outside-of-Docker (if supported by TAG)
266+
# a la https://github.com/devcontainers/features/blob/main/src/docker-outside-of-docker/install.sh
267+
try:
268+
subprocess.check_output(["docker", "exec", container, "sudo", "/etc/init.d/docker", "start"])
269+
except subprocess.CalledProcessError:
270+
pass
271+
263272
# List port mappings
264273
print(ports(container))
265274

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"console_scripts": ["cli50=cli50.__main__:main"]
2525
},
2626
url="https://github.com/cs50/cli50",
27-
version="7.4.2",
27+
version="7.5.1",
2828
include_package_data=True
2929
)

0 commit comments

Comments
 (0)