Skip to content
Open
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
10 changes: 9 additions & 1 deletion applications/dev-environment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,15 @@ Here are the steps required:
2. **Version**: Press Enter to use 'main' (recommended)
3. **Continue if directory not empty**: Type 'y' and press Enter (since you downloaded the setup-container script)

3. **Open in VS Code:**
3. **Create .env file**

Make sure your ssh agent is running and a key is added

```bash
./devrd env
```

4. **Open in VS Code:**
Then open the workspace in Visual Studio Code:

```bash
Expand Down
28 changes: 14 additions & 14 deletions applications/dev-environment/devcontainer/setup-container
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ install_devcontainer() {
fi
WORKSPACE_DIR=$(realpath -m "$WORKSPACE_DIR")

read -p "Enter the version of the everest-dev-environment (default is 'main'): " VERSION
read -p "Enter the version of the everest-core (default is 'main'): " VERSION
if [ -z "$VERSION" ]; then
VERSION="main"
fi

echo "Create the workspace directory '$WORKSPACE_DIR' if it does not exist"
mkdir -p $WORKSPACE_DIR

# Check if workspace directory has files other than everest-dev-environment
WORKSPACE_CONTENTS=$(ls -A $WORKSPACE_DIR 2>/dev/null | grep -v "^everest-dev-environment$" || true)
# Check if workspace directory has files other than everest-core
WORKSPACE_CONTENTS=$(ls -A $WORKSPACE_DIR 2>/dev/null | grep -v "^everest-core$" || true)
if [ -n "$WORKSPACE_CONTENTS" ]; then
# The workspace directory is not empty (excluding everest-dev-environment), warning do you want to continue?
# The workspace directory is not empty (excluding everest-core), warning do you want to continue?
read -p "The workspace directory is not empty, do you want to continue? (y/N): " -r
case "$REPLY" in
[Nn]|"")
Expand All @@ -40,19 +40,19 @@ install_devcontainer() {
esac
fi

# Check if everest-dev-environment exists locally
if [ -d "everest-dev-environment" ]; then
echo "Found local everest-dev-environment directory, using it instead of cloning..."
SOURCE_DIR="everest-dev-environment"
# Check if everest-core exists locally
if [ -d "everest-core" ]; then
echo "Found local everest-core directory, using it instead of cloning..."
SOURCE_DIR="everest-core"
else
echo "No local everest-dev-environment found, cloning from GitHub..."
echo "No local everest-core found, cloning from GitHub..."
TMP_DIR=$(mktemp --directory)
git clone --quiet --depth 1 --single-branch --branch "$VERSION" https://github.com/EVerest/everest-dev-environment.git "$TMP_DIR"
git clone --quiet --depth 1 --single-branch --branch "$VERSION" https://github.com/EVerest/everest-core.git "$TMP_DIR"
SOURCE_DIR="$TMP_DIR"
fi

echo "Copy the template devcontainer configuration files to the workspace directory"
cp -n -r $SOURCE_DIR/devcontainer/template/. $WORKSPACE_DIR/
cp -n -r $SOURCE_DIR/applications/dev-environment/devcontainer/. $WORKSPACE_DIR/

# Ensure devrd script is executable
if [ -f "$WORKSPACE_DIR/devrd" ]; then
Expand All @@ -63,8 +63,8 @@ install_devcontainer() {
fi

# Only remove temporary directory if we cloned it
if [ "$SOURCE_DIR" != "everest-dev-environment" ]; then
echo "Remove the temporary everest-dev-environment repository"
if [ "$SOURCE_DIR" != "everest-core" ]; then
echo "Remove the temporary everest-core repository"
rm -rf "$SOURCE_DIR"
fi

Expand Down Expand Up @@ -138,4 +138,4 @@ while [ $# -gt 0 ]; do
done

# Execute the installation
install_devcontainer
install_devcontainer
Loading