Skip to content

Commit

Permalink
Makefile fix, cli writing to stderr (fixing tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomo-mondreganto committed Jun 29, 2021
1 parent b3c4ee8 commit 780f3e4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -2,7 +2,7 @@
lint-backend:
flake8 --config .flake8

.PHONY: lint-frontend:
.PHONY: lint-frontend
lint-frontend:
cd front && npx eslint .

Expand Down
4 changes: 2 additions & 2 deletions cli/kube/destroy.py
Expand Up @@ -25,7 +25,7 @@ def destroy():
for entry in to_unset:
utils.run_command(['kubectl', 'config', 'unset', entry])

click.echo('Cleaning up the registry')
click.echo('Cleaning up the registry', err=True)
cmd = [
'yc', 'container', 'image', 'list',
'--registry-id', registry_id,
Expand All @@ -35,7 +35,7 @@ def destroy():
for image in registry_images:
image_id = image['id']
image_name = image['name']
click.echo(f'Removing image {image_name}')
click.echo(f'Removing image {image_name}', err=True)
utils.run_command(['yc', 'container', 'image', 'delete', image_id])

utils.run_command(
Expand Down
8 changes: 5 additions & 3 deletions cli/utils.py
Expand Up @@ -121,6 +121,7 @@ def setup_auxiliary_structure(config: models.BasicConfig) -> models.Config:


def run_command(command: List[str], cwd=None, env=None):
print_bold(f'Running command {command}')
p = subprocess.Popen(command, cwd=cwd, env=env)
rc = p.wait()
if rc != 0:
Expand All @@ -129,6 +130,7 @@ def run_command(command: List[str], cwd=None, env=None):


def get_output(command: List[str], cwd=None, env=None) -> str:
print_bold(f'Running command {command}')
return subprocess.check_output(command, cwd=cwd, env=env).decode()


Expand Down Expand Up @@ -166,15 +168,15 @@ def print_file_exception_info(_func, path, _exc_info):


def print_error(message: str):
click.secho(message, fg='red')
click.secho(message, fg='red', err=True)


def print_success(message: str):
click.secho(message, fg='green')
click.secho(message, fg='green', err=True)


def print_bold(message: str):
click.secho(message, bold=True)
click.secho(message, bold=True, err=True)


def remove_file(path: Path):
Expand Down
24 changes: 12 additions & 12 deletions front/.eslintrc.js
@@ -1,14 +1,14 @@
module.exports = {
root: true,
env: {
node: true
},
extends: ["plugin:vue/essential", "@vue/prettier"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
},
parserOptions: {
parser: "babel-eslint"
}
root: true,
env: {
node: true,
},
extends: ['plugin:vue/essential', '@vue/prettier'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
parserOptions: {
parser: 'babel-eslint',
},
};

0 comments on commit 780f3e4

Please sign in to comment.