diff --git a/cd/__init__.py b/cd/__init__.py index e045397..8f2bf6e 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -21,10 +21,20 @@ 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) +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} @@ -35,7 +45,7 @@ def cd_clone_branch(): '--branch', project.branch, '--', project.url, - os.path.realpath(os.curdir), + project.root, ) @@ -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-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}" 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 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'