Skip to content

Commit

Permalink
create env var for offline codespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rongxin-liu committed Jun 13, 2024
1 parent 251656f commit 347553a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions etc/profile.d/codespace.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# If not root
if [ "$(whoami)" != "root" ]; then

# Check if running locally and set $RepositoryName if not already set
if [[ "$CODESPACES" != "true" && -z "$RepositoryName" ]]; then
export RepositoryName=$(ls -1t --color=never /workspaces | tail -1 | sed 's:/*$::')
export LOCAL_WORKSPACE_FOLDER="/workspaces/$RepositoryName"
fi

# Rewrites URLs of the form http://HOST:PORT as https://$CODESPACE_NAME.app.github.dev:PORT
_hostname() {

Expand Down

0 comments on commit 347553a

Please sign in to comment.