Skip to content

Commit

Permalink
fix: escape slash on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed Feb 2, 2024
1 parent d531bab commit 4556c7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ const locationFromShell = shell => {
* @param {SupportedShell} shell - Shell to base the check on
*/
const sourceLineForShell = (scriptname, shell) => {
// Windows naturally uses `\` as path separator, which would be misinterpreted by the
// shell interpreters.
scriptname = scriptname.replaceAll('\\', '/');

if (shell === 'fish') {
return `[ -f ${scriptname} ]; and . ${scriptname}; or true`;
}
Expand Down

0 comments on commit 4556c7e

Please sign in to comment.