Skip to content

Commit

Permalink
feat(dev): more public devcontainer fixes/enhancements
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
sgammon committed Oct 10, 2023
1 parent 51896af commit 988a564
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update \
curl \
uuid-runtime \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/lib/elide \
&& mkdir -p /usr/lib/elide /home/vscode/.elide \
&& echo "Installing Elide..." \
&& curl -sSL elide.sh | bash -s - --install-dir=/usr/lib/elide \
&& ln -s /usr/lib/elide/elide /bin/elide \
Expand Down
44 changes: 36 additions & 8 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://github.com/elide-dev">
<img src="https://static.elide.dev/assets/org-profile/creative/elide-banner-purple.png" alt="Elide" height=120 />
<img src="https://static.elide.dev/assets/org-profile/creative/elide-banner-purple.png" alt="Elide" height=240 />
</a>
</p>

Expand All @@ -10,32 +10,60 @@ This GitHub Codespace comes pre-installed with the latest version of [Elide](htt

## Stuff to try

**To see available commands:**
```
elide --help
```
**Your terminal should already be open at the bottom of your screen.** We have already taken care of running the first command, `elide --help`, for you. Here's some more stuff you can try.

### Basic commands

**To see runtime info:**
```
elide info
```

**To verify working installation:**
```
elide selftest
```

### JavaScript

**To run a JavaScript terminal:**
```
elide shell
```

**Encode some JSON:**
```javascript
JSON.stringify({x: 5})
```

**To see `.env` environment:**
```python
JSON.stringify(process.env)
```

**Generate a UUID:**
```javascript
crypto.randomUUID()+""
```

**Parse a URL and print the host:**
```javascript
new URL("https://google.com").host
```

**To run a JavaScript server:**
```
elide serve tools/scripts/server.js
```

### Python

**To run a Python terminal:**
```
elide shell --python
```

**To verify working installation:**
```
elide selftest
**To see `.env` environment:**
```python
import os; os.environ
```
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dockerfile": "Dockerfile"
},
"runArgs": ["--init", "--privileged"],
"postAttachCommand": "code .devcontainer/README.md && elide --help",
"postAttachCommand": "echo 'ELIDE_CODESPACE=true' > .env && touch package.json && code .devcontainer/README.md && clear && elide --help",
"overrideCommand": false,
"features": {
"ghcr.io/devcontainers/features/git:1": {},
Expand Down

0 comments on commit 988a564

Please sign in to comment.