Skip to content

Git Bash will error when a .repl_history file is created by PowerShell #112

@JamesEarle

Description

@JamesEarle

If no .repl_history file exists, then running the repl in Git Bash works as expected. I am also able to run the repl in PowerShell as expected, but only PowerShell will create a .repl_history file. If I try to run in Git Bash now that the file exists, I receive the error below.

C:\Users\Administrator\Documents\Code\MyApp\node_modules\prix-fixe\src\repl\repl_core2.ts:172
                .map((line: string) => (repl as any).history.push(line));
                                                             ^
TypeError: Cannot read property 'push' of undefined
    at ReplCore.fs.readFileSync.toString.split.reverse.filter.map (C:\Users\Administrator\Documents\Code\MyApp\node_modules\prix-fixe\src\repl\repl_core2.ts:172:62)
    at Array.map (<anonymous>)
    at new ReplCore (C:\Users\Administrator\Documents\Code\MyApp\node_modules\prix-fixe\src\repl\repl_core2.ts:172:18)
    at Object.runRepl (C:\Users\Administrator\Documents\Code\MyApp\node_modules\prix-fixe\src\repl\repl_core2.ts:575:18)
    at Object.replMain (C:\Users\Administrator\Documents\Code\MyApp\node_modules\prix-fixe\src\repl\repl_main.ts:30:5)
    at go (C:\Users\Administrator\Documents\Code\MyApp\tests\repl.ts:84:5)
    at Object.<anonymous> (C:\Users\Administrator\Documents\Code\MyApp\tests\repl.ts:87:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Module.m._compile (C:\Users\Administrator\Documents\Code\MyApp\node_modules\ts-node\src\index.ts:473:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ramsay-service@1.0.0 repl: `ts-node -r dotenv/config ./tests/repl.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ramsay-service@1.0.0 repl script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-09-11T17_37_20_766Z-debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions