File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,16 +51,17 @@ if (import.meta.main) {
5151 // detect shell type and inject `wql` alias
5252 try {
5353 const shell = detectDefaultShell ( ) ;
54+ const shellName = path . basename ( shell ) ;
5455
5556 // TODO: other shell types?
56- if ( shell === "/bin/ bash" || shell === "/bin/ zsh" ) {
57+ if ( shellName === "bash" || shellName === "zsh" ) {
5758 const rcFile = ( ( ) => {
5859 const zDotDir = Deno . env . get ( "ZDOTDIR" ) ;
59- if ( shell === "/bin/ zsh" && zDotDir ) {
60+ if ( shellName === "zsh" && zDotDir ) {
6061 return path . join ( zDotDir , ".zshrc" ) ;
6162 }
6263
63- const rc = shell === "/bin/ bash" ? ".bashrc" : ".zshrc" ;
64+ const rc = shellName === "bash" ? ".bashrc" : ".zshrc" ;
6465 return path . join ( homedir ( ) , rc ) ;
6566 } ) ( ) ;
6667
@@ -83,7 +84,7 @@ if (import.meta.main) {
8384 await writer . ready ;
8485 await writer . close ( ) ;
8586
86- updatedShell = shell === "/bin/ bash" ? "bash" : "zsh" ;
87+ updatedShell = shellName === "bash" ? "bash" : "zsh" ;
8788 }
8889 }
8990 } catch ( _error ) {
You can’t perform that action at this time.
0 commit comments