Skip to content

Npm version of jscc doesn't work on Linux #87

@jcubic

Description

@jcubic

they have \r which break the file in bash/linux probably the same on MacOSX, I got this when I've try to execute the script after install

$ jscc-node
/usr/bin/env: „node\r”: No such file or directory
$ which node
/usr/bin/node

I needed to strip the \r from the file using: dos2unix also there are no sh files in dest directory only symlinks to js files:

ls /usr/bin/jscc-*
/usr/bin/jscc-browser  /usr/bin/jscc-node
/usr/bin/jscc-nashorn  /usr/bin/jscc-rhino

this is not how symlinks work the cwd point file point to /usr/bin/ not the path where the original js file is located.

to make it work I need to run:

cd /usr/lib/node_modules/jscc-parser/bin/
ls | sudo xargs dos2unix
sudo chmod a+x jscc-node.sh

and then I could run the generator:

/usr/lib/node_modules/jscc-parser/bin/jscc-node.sh gramar.jscc > parser.js

the fix is to include post install script that will make script executable using chmod and maybe jscc-node in /usr/bin be scripts that execute

#!/bin/bash
/usr/lib/node_modules/jscc-parser/bin/jscc-node.sh $@

and maybe don't use \r at all browser and node will handle just \n and most editors/ide also can create files with just \n.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions