-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
One
number one on my wtf list is this:
#!/bin/sh
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
console.log('Hello world');I understand this part: $(command -v nodejs || command -v node)" "$0" "$@"
- if there's a command on called nodejs, or node, then
- execute the current file "$0" with whatever args were passed originally "$@"
but the part I'm not entirely understanding is ':' //; :
':'i get that this is just a string so bash does nothing with it?// ;???? lmao wut?
Second
this lead me to be think about the experience editing this file:
- because it ends in
.sh, or - because there's no vim modelines,
There's no automatic correct syntax highlighting (whole file is considered bash so shellcheck screams about everything)
So the second question is did you try this instead:
- rename the file to rofi-search.js (now the file gets automatic syntax highlighting regardless of the editor)
- change the hashbang to
#!/usr/bin/env node(now the js file will execute with nodejs)
My only assumption is that you're trying to account for ubuntu users that incorrectly have nodejs installed via apt as nodejs.
Metadata
Metadata
Assignees
Labels
No labels