david-plugge / tailwindcss-extend

MIT License
16 stars 1 forks source link

Add shebang to binary #9

Closed hbendev closed 6 months ago

hbendev commented 6 months ago

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch tailwindcss-extend@0.0.4 for the project I'm working on.

Upon runing npx tailwindcss-extend the process immediately failed.

$ npx tailwindcss-extend
/Users/hbendev/.npm/_npx/eebc62b9cd0cd23f/node_modules/.bin/tailwindcss-extend: line 1: import: command not found

Here are my environment details.

npx envinfo
  System:
    OS: macOS 13.6.4
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.0/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash

Here is the diff that solved my problem:

diff --git a/node_modules/tailwindcss-extend/dist/cli.js b/node_modules/tailwindcss-extend/dist/cli.js
index ed45313..c96279f 100755
--- a/node_modules/tailwindcss-extend/dist/cli.js
+++ b/node_modules/tailwindcss-extend/dist/cli.js
@@ -1,3 +1,4 @@
+#!/usr/bin/env node
 import {
   bundle
 } from "./chunk-BUKARI4R.js";

Acording to a quick search, this path seems the best option: https://stackoverflow.com/questions/20638520/appropriate-hashbang-for-node-js-scripts

This issue body was partially generated by patch-package.

david-plugge commented 6 months ago

Hey, good catch, will add that :)