Skip to content

Commit

Permalink
fix bin (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
safareli authored Apr 2, 2019
1 parent aa13d04 commit 50f9865
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
2 changes: 0 additions & 2 deletions chanterelle-bin.js

This file was deleted.

17 changes: 17 additions & 0 deletions chanterelle-bin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash


if [ ! -d './output' ]
then
echo "No './output' directory, make sure to compile purescript project."
exit 1
fi


if [ ! -f './output/ChanterelleMain/index.js' ]
then
echo "Make sure you have purescript-chantrelle in your purescript dependencies and it is compiled."
exit 1
fi

node -e "require('./output/ChanterelleMain/index.js').main();" -- "chanterelle" $*
10 changes: 10 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ Or if you would like to install specific version like `v9.9.9 for example do:
.. code-block:: shell

npm install -g f-o-a-m/chanterelle#v9.9.9

you can also install it locally for particular project too:


.. code-block:: shell

npm install f-o-a-m/chanterelle


NOTE: The projects where CLI is used, must also have chanterelle in it's purescript dependencies and whole purescript project should be compiled already.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
"description": "A more functional truffle",
"license": "ISC",
"scripts": {
"postinstall": "bower install --production && pulp build",
"build": "pulp build",
"docs": "cd docs; make html;"
},
"dependencies": {
"devDependencies": {
"purescript": "^0.12.0",
"pulp": "^12.2.0",
"purescript-psa": "^0.6.0",
Expand All @@ -22,6 +21,6 @@
"solc": "^0.4.24"
},
"bin": {
"chanterelle": "chanterelle-bin.js"
"chanterelle": "chanterelle-bin.sh"
}
}
8 changes: 7 additions & 1 deletion src/ChanterelleMain.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
"use strict";

var path = require('path')
exports.loadDeployMFromScriptPath = function (filePath) {
return function () {
return require(filePath).deploy;
var scriptPath = path.isAbsolute(filePath) ? filePath : path.join (process.cwd(), filePath);
var script = require(scriptPath).deploy
if (script == undefined) {
throw "Deploy script is invalid: " + scriptPath
}
return script;
};
};

Expand Down

0 comments on commit 50f9865

Please sign in to comment.