Skip to content

Creating a service for package.json scripts #12

@Vap0r1ze

Description

@Vap0r1ze

My "start" script is tsx src/index.ts so I tried the following:

# ser create --name jewel --start --enable --interpreter $(which pnpm) start
# ser create --name jewel --start --enable --interpreter $PWD/node_modules/.bin/tsx src/index.ts

The first was me hoping it didnt check if the file was real, but it does so that "hack" didnt work.
The second didn't work because tsx's hashbang gets node from the env, which doesn't exist til ~/.bashrc is ran.

I suggest there should be a builtin way to do package.json scripts as services, or the even more abstractly any command.
Until then my workaround is to make an executable: printf '#!'$(which bash)'\npnpm start\n' this did not work either lol

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions