Skip to content

Commit

Permalink
fix: folder creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Morriz committed May 20, 2024
1 parent b111e4b commit 587f3d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 99 deletions.
4 changes: 2 additions & 2 deletions bin/export-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env_file=upstream/$project/.env
if [ -f "$env_file" ]; then
unamestr=$(uname)
if [ "$unamestr" = 'Linux' ]; then
export $(grep -v '^#' $env_file | xargs -d '\n')
export $(grep -v '^#' "$env_file" | xargs -d '\n')
elif [ "$unamestr" = 'FreeBSD' ] || [ "$unamestr" = 'Darwin' ]; then
export $(grep -v '^#' $env_file | xargs -0)
export $(grep -v '^#' "$env_file" | xargs -0)
fi
fi
13 changes: 9 additions & 4 deletions lib/upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ def write_upstream(project: Project) -> None:
def write_upstream_volume_folders(project: Project) -> None:
for s in project.services:
for path in s.volumes:
# strip parts such as :ro and :rw from the end first
path = path.rsplit(":", 1)[0]
# if occurences of colon > 1 then:
if path.count(":") > 1:
# strip parts such as :ro and :rw from the end first
path = path.rsplit(":", 1)[0]
# if path still contains colon, and starts with '/' or '../', then we know its an existing host path, so skip
if ":" in path and path.startswith("/") or path.startswith("../"):
continue
# check if it still has a colon, if so, split it and get the first part, else use the whole path
path = path.split(":", 1)[0] if ":" in path else path
# remove leading dot
path = path[1:] if path.startswith(".") else path
# remove leading dot or add slash if
path = path[1:] if path.startswith(".") else "/" + path if not path.startswith("/") else path
os.makedirs(f"upstream/{project.name}{path}", exist_ok=True)


Expand Down
93 changes: 0 additions & 93 deletions proxy/docker-compose.yml

This file was deleted.

0 comments on commit 587f3d0

Please sign in to comment.