From 40e80c90b0e141afb4518449f37d6df8d2d242af Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 00:49:23 +0200 Subject: [PATCH 1/4] sorted --- cd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index e045397..cb95ebf 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -21,7 +21,7 @@ def cd_browse_workspace(): absolute_path = os.path.join(directory, file) relative_path = os.path.relpath(absolute_path, start=project.root) paths.append(relative_path) - for path in paths: + for path in sorted(paths): print(path) From 50247d02dd493dc077d2b4e8c819f07b1063fccc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 12:00:26 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=E2=88=92.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/cd-browse-workspace.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100755 cmd/cd-browse-workspace.sh diff --git a/cmd/cd-browse-workspace.sh b/cmd/cd-browse-workspace.sh deleted file mode 100755 index b99d6d2..0000000 --- a/cmd/cd-browse-workspace.sh +++ /dev/null @@ -1 +0,0 @@ -tree -a "${GITHUB_WORKSPACE}" From 380684eed988447de1150da838625fcfa40e00ee Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 12:03:15 +0200 Subject: [PATCH 3/4] cd-clone-branch --- cd/__init__.py | 2 +- cmd/cd-clone-branch.sh | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100755 cmd/cd-clone-branch.sh diff --git a/cd/__init__.py b/cd/__init__.py index cb95ebf..c161dd6 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -35,7 +35,7 @@ def cd_clone_branch(): '--branch', project.branch, '--', project.url, - os.path.realpath(os.curdir), + project.root, ) diff --git a/cmd/cd-clone-branch.sh b/cmd/cd-clone-branch.sh deleted file mode 100755 index e84ff7b..0000000 --- a/cmd/cd-clone-branch.sh +++ /dev/null @@ -1,8 +0,0 @@ -git clone \ ---branch "${GITHUB_REF_NAME}" \ --- \ -"${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \ -'.' - -rm --force --recursive \ -'.git' '.gitignore' From 5a2cf6253bbf62c35f4e7a41f54b2d5f45bf100d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 12:35:05 +0200 Subject: [PATCH 4/4] build-project --- cd/__init__.py | 11 +++++++++++ cmd/cd-build-project.sh | 9 --------- 2 files changed, 11 insertions(+), 9 deletions(-) delete mode 100755 cmd/cd-build-project.sh diff --git a/cd/__init__.py b/cd/__init__.py index c161dd6..8f2bf6e 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -25,6 +25,16 @@ def cd_browse_workspace(): print(path) +def cd_build_project(): + for extension in ['py', 'sh']: + path = os.path.join(project.root, f'build.{extension}') + if os.path.exists(path): + ps.run(path) + break + else: + pass + + def cd_clone_branch(): print(f'''\ {project.url} @@ -48,6 +58,7 @@ def install_commands(path): user = '/usr/local/bin' for command in [ 'browse-workspace', + 'build-project', 'clone-branch', 'list-environment', ]: diff --git a/cmd/cd-build-project.sh b/cmd/cd-build-project.sh deleted file mode 100755 index 460566e..0000000 --- a/cmd/cd-build-project.sh +++ /dev/null @@ -1,9 +0,0 @@ -if [ -x './build.py' ] ; then - ./build.py \ - || exit -elif [ -x './build.sh' ] ; then - ./build.sh \ - || exit -else - exit -fi