Skip to content

Commit

Permalink
Merge branch 'main' into rongxin-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan authored Jul 6, 2024
2 parents d90fe77 + 14d34fa commit 3fc16d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Create Release
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
Expand Down
9 changes: 9 additions & 0 deletions cli50/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def main():
# Options
workdir = "/mnt"
options = ["--detach",
"--env", f"LOCAL_WORKSPACE_FOLDER={directory}",
"--env", f"TZ={tzlocal.get_localzone_name()}",
"--env", f"WORKDIR={workdir}",
"--interactive",
Expand All @@ -214,6 +215,7 @@ def main():
"--security-opt", "seccomp=unconfined", # https://stackoverflow.com/q/35860527#comment62818827_35860527, https://github.com/apple/swift-docker/issues/9#issuecomment-328218803
"--tty",
"--volume", directory + ":" + workdir,
"--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
"--workdir", workdir]

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

# Start Docker-outside-of-Docker (if supported by TAG)
# a la https://github.com/devcontainers/features/blob/main/src/docker-outside-of-docker/install.sh
try:
subprocess.check_output(["docker", "exec", container, "sudo", "/etc/init.d/docker", "start"])
except subprocess.CalledProcessError:
pass

# List port mappings
print(ports(container))

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"console_scripts": ["cli50=cli50.__main__:main"]
},
url="https://github.com/cs50/cli50",
version="7.4.2",
version="7.5.1",
include_package_data=True
)

0 comments on commit 3fc16d8

Please sign in to comment.