Compare commits
No commits in common. "ab2560ded20e8ff94b2757d6acb67c1dd7aa7834" and "8c016627f95f6e613d6fce3476a37ead619c6bd1" have entirely different histories.
ab2560ded2
...
8c016627f9
4 changed files with 20 additions and 19 deletions
|
@ -1,10 +1,10 @@
|
|||
import os
|
||||
|
||||
import env
|
||||
from rwx import fs, ps
|
||||
|
||||
from cd.project import Project
|
||||
from cd.projects import Projects
|
||||
import env
|
||||
from rwx import fs
|
||||
from rwx import ps
|
||||
|
||||
COMMANDS_PREFIX = "cd-"
|
||||
|
||||
|
@ -119,9 +119,9 @@ def set_ssh(*arguments):
|
|||
if ssh_hosts:
|
||||
fs.write(known, ssh_hosts)
|
||||
os.chmod(known, 0o400)
|
||||
cat(known)
|
||||
#
|
||||
browse(ssh)
|
||||
cat(known)
|
||||
|
||||
|
||||
def open(*arguments):
|
||||
|
|
|
@ -5,13 +5,14 @@ import sys
|
|||
|
||||
import cd
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
if __name__ == '__main__':
|
||||
command, *arguments = sys.argv
|
||||
command = os.path.basename(command)
|
||||
if command == "__main__.py":
|
||||
if command == '__main__.py':
|
||||
cd.set_ssh(*arguments)
|
||||
cd.install_commands(__file__)
|
||||
else:
|
||||
command = command.replace("-", "_")
|
||||
command = command.replace('-', '_')
|
||||
function = getattr(cd, command)
|
||||
function(*arguments)
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
from os import path
|
||||
|
||||
BRANCH = [
|
||||
"GITHUB_REF_NAME",
|
||||
"CI_COMMIT_BRANCH",
|
||||
'GITHUB_REF_NAME',
|
||||
'CI_COMMIT_BRANCH',
|
||||
]
|
||||
NAME = [
|
||||
"GITHUB_REPOSITORY",
|
||||
"CI_PROJECT_PATH",
|
||||
'GITHUB_REPOSITORY',
|
||||
'CI_PROJECT_PATH',
|
||||
]
|
||||
ROOT = [
|
||||
"GITHUB_WORKSPACE",
|
||||
"CI_PROJECT_DIR",
|
||||
'GITHUB_WORKSPACE',
|
||||
'CI_PROJECT_DIR',
|
||||
]
|
||||
|
||||
|
||||
class Project:
|
||||
def __init__(self, projects) -> None:
|
||||
def __init__(self, projects):
|
||||
self.projects = projects
|
||||
# branch
|
||||
for variable in BRANCH:
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
from os import path
|
||||
|
||||
GROUP_AND_NAME = [
|
||||
"GITHUB_REPOSITORY",
|
||||
"CI_PROJECT_PATH",
|
||||
'GITHUB_REPOSITORY',
|
||||
'CI_PROJECT_PATH',
|
||||
]
|
||||
SERVER_URL = [
|
||||
"GITHUB_SERVER_URL",
|
||||
"CI_SERVER_URL",
|
||||
'GITHUB_SERVER_URL',
|
||||
'CI_SERVER_URL',
|
||||
]
|
||||
|
||||
|
||||
class Projects:
|
||||
def __init__(self, environment) -> None:
|
||||
def __init__(self, environment):
|
||||
self.environment = environment
|
||||
# group, name
|
||||
for variable in GROUP_AND_NAME:
|
||||
|
|
Loading…
Add table
Reference in a new issue