Socket
Socket
Sign inDemoInstall

git-bash-shell

Package Overview
Dependencies
116
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    git-bash-shell

Use Git Bash as cross-platform shell for Windows


Version published
Maintainers
1
Created

Readme

Source

git-bash-shell

NPM version AppVeyor Codecov David

Use Git Bash as cross-platform shell for Windows

Why

Install

npm install --save git-bash-shell

Please restart your terminal after successful installation.

Usage

  • npm config

    These npm config items will be compatible under Windows:

    You can edit .npmrc to use a unified terminal:

      shell=/bin/bash
      script-shell=/bin/sh
    
  • env command

    In your package.json file, you can add script prefix env to compatible with Widnows:

    "scripts": {
      "posix": "env echo $SHELL",
    }
    

    Just run npm run posix, it will run for Windows and POSIX

  • Node API:

    await require('git-bash-shell')();
    const spawnSync = require('cross-spawn').sync;
    spawnSync('echo $(git --version)', {
      shell: '/bin/sh',
      stdio: 'inherit',
    });
    

Environment Variables

SHELL

  • Default: /bin/sh
  • Type: path

POSIX specific implementations of shell path.

Keywords

FAQs

Last updated on 20 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc