Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bin #100

Merged
merged 6 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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