Skip to content

Commit

Permalink
perf: allow cross platform commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dillionmegida committed Apr 18, 2020
1 parent 22b3ff2 commit f9535b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"bin"
],
"keywords": [
"git, easy-git, e-git, git-aliases"
"git, easy-git, esgit, git-aliases"
],
"author": "Dillion Megida <dillionmegida@gmail.com>",
"license": "MIT",
Expand All @@ -33,7 +33,8 @@
"esgit": "./bin/index.js"
},
"dependencies": {
"chalk": "^4.0.0"
"chalk": "^4.0.0",
"cross-cmd": "^1.0.0"
},
"config": {
"ghooks": {
Expand Down
5 changes: 4 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const readline = require("readline");
const chalk = require("chalk");
const fs = require("fs");
const path = require("path");
const crossCommand = require("cross-cmd");

const rl = readline.createInterface({
input: process.stdin,
Expand Down Expand Up @@ -173,7 +174,9 @@ const writeToFile = (title, body, pathToFile) => {
};

const readFile = (pathToFile) => {
execCommand(`cat ${path.join(__dirname, pathToFile)}`);
execCommand(
`${crossCommand("readfile")} ${path.join(__dirname, pathToFile)}`
);
};

const writeCommandHelp = (command) => {
Expand Down

0 comments on commit f9535b9

Please sign in to comment.