Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(windows): Use `@echo off` in batch scripts #310

Merged
merged 1 commit into from Jan 12, 2020

Conversation

@StephenRoille
Copy link
Contributor

StephenRoille commented Jan 8, 2020

The batch echo mode is ON by default on Windows. As a result, running
a custom CLI keep printing out the script location and the command that
was run.

Here is a custom CLI tool called git-conventional-commit,

With echo OFF (expected behavior):

git-conventional-changelog . -o
-o requires argument
Usage:
    git-conventional-changelog REPO [--output=<str>][--show-scope][--fake][--verbose]
    git-conventional-changelog -h | --help
    git-conventional-changelog --version

With echo ON (noise added to the command output):

git-conventional-changelog . -o

"C:\Users\Stephen\venv_projects\mylibs\git_history\venv\Scripts\python.exe" "C:\Users\Stephen\venv_projects\mylibs\git_history\venv\Scripts\\git-conventional-changelog" . -o
-o requires argument
Usage:
    git-conventional-changelog REPO [--output=<str>][--show-scope][--fake][--verbose]
    git-conventional-changelog -h | --help
    git-conventional-changelog --version
The batch `echo` mode is ON by default on Windows. As a result,
executing custom CLI scripts keep printing out the script file location
and command that was run.

For instance, here is a custom CLI tool called `git-conventional-commit`

With echo OFF (expected behavior):

```bash
git-conventional-changelog . -o
-o requires argument
Usage:
    git-conventional-changelog REPO [--output=<str>][--show-scope][--fake][--verbose]
    git-conventional-changelog -h | --help
    git-conventional-changelog --version
```

With echo ON (add noise to the command output):

```bash
git-conventional-changelog . -o

"C:\Users\Stephen\venv_projects\mylibs\git_history\venv\Scripts\python.exe" "C:\Users\Stephen\venv_projects\mylibs\git_history\venv\Scripts\\git-conventional-changelog" . -o
-o requires argument
Usage:
    git-conventional-changelog REPO [--output=<str>][--show-scope][--fake][--verbose]
    git-conventional-changelog -h | --help
    git-conventional-changelog --version
```
@takluyver takluyver merged commit 7cd39b0 into takluyver:master Jan 12, 2020
3 of 4 checks passed
3 of 4 checks passed
codecov/patch 0% of diff hit (target 86.36%)
Details
codecov/project 86.36% remains the same compared to 9d072eb
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@takluyver

This comment has been minimized.

Copy link
Owner

takluyver commented Jan 12, 2020

Thanks! We should probably use exe wrappers instead of .cmd scripts, for all the reasons @pfmoore gave in these notes. But Windows specific fixes are never going to come high on my priority list, and I can see that this is likely a net improvement. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.