From ef6a45ef718508b83f82aefee1be2822dd34e069 Mon Sep 17 00:00:00 2001 From: Irakli Safareli Date: Tue, 2 Apr 2019 09:14:13 +0400 Subject: [PATCH 1/6] fix bin --- chanterelle-bin.js | 2 -- chanterelle-bin.sh | 17 +++++++++++++++++ package.json | 5 ++--- 3 files changed, 19 insertions(+), 5 deletions(-) delete mode 100755 chanterelle-bin.js create mode 100755 chanterelle-bin.sh diff --git a/chanterelle-bin.js b/chanterelle-bin.js deleted file mode 100755 index 67c077a..0000000 --- a/chanterelle-bin.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('./output/ChanterelleMain/index.js').main(); \ No newline at end of file diff --git a/chanterelle-bin.sh b/chanterelle-bin.sh new file mode 100755 index 0000000..4069c02 --- /dev/null +++ b/chanterelle-bin.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + +if [ ! -d './output' ] +then + echo "No './output' directory, make sure to compile purescript project." + exit +fi + + +if [ ! -f './output/ChanterelleMain/index.js' ] +then + echo "Make sure you have purescript-chantrelle in your purescript dependencies and it is compiled." + exit +fi + +node -e "require('./output/ChanterelleMain/index.js').main();" diff --git a/package.json b/package.json index a6cc9e6..335ba77 100644 --- a/package.json +++ b/package.json @@ -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", @@ -22,6 +21,6 @@ "solc": "^0.4.24" }, "bin": { - "chanterelle": "chanterelle-bin.js" + "chanterelle": "chanterelle-bin.sh" } } From f469c69a00b8f84105dd69cbbd6742e3c1f14c50 Mon Sep 17 00:00:00 2001 From: Irakli Safareli Date: Tue, 2 Apr 2019 09:30:34 +0400 Subject: [PATCH 2/6] update installation.rst --- docs/installation.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/installation.rst b/docs/installation.rst index d136425..11a95b9 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -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. \ No newline at end of file From 6ac873968c1d851e0b517040a271450aebfa443d Mon Sep 17 00:00:00 2001 From: Irakli Safareli Date: Tue, 2 Apr 2019 09:34:04 +0400 Subject: [PATCH 3/6] fix args --- chanterelle-bin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chanterelle-bin.sh b/chanterelle-bin.sh index 4069c02..e332c42 100755 --- a/chanterelle-bin.sh +++ b/chanterelle-bin.sh @@ -14,4 +14,4 @@ then exit fi -node -e "require('./output/ChanterelleMain/index.js').main();" +node -e "console.log(process.argv);require('./output/ChanterelleMain/index.js').main();" -- "chanterelle" $* From 7e9360d1339285a2ecb029591c703a727458ecb2 Mon Sep 17 00:00:00 2001 From: Irakli Safareli Date: Tue, 2 Apr 2019 09:50:28 +0400 Subject: [PATCH 4/6] exit 1 --- chanterelle-bin.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chanterelle-bin.sh b/chanterelle-bin.sh index e332c42..c086445 100755 --- a/chanterelle-bin.sh +++ b/chanterelle-bin.sh @@ -4,14 +4,14 @@ if [ ! -d './output' ] then echo "No './output' directory, make sure to compile purescript project." - exit + 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 + exit 1 fi node -e "console.log(process.argv);require('./output/ChanterelleMain/index.js').main();" -- "chanterelle" $* From 7e7bd535f7fa4db7af9ea7861a73f19129e0e06a Mon Sep 17 00:00:00 2001 From: Irakli Safareli Date: Tue, 2 Apr 2019 14:11:58 +0400 Subject: [PATCH 5/6] fix script deploy loading --- src/ChanterelleMain.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChanterelleMain.js b/src/ChanterelleMain.js index afca514..d475a78 100644 --- a/src/ChanterelleMain.js +++ b/src/ChanterelleMain.js @@ -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; }; }; From 3095e8d37989110720532e11d23df38807f188c1 Mon Sep 17 00:00:00 2001 From: Irakli Safareli Date: Tue, 2 Apr 2019 15:16:42 +0400 Subject: [PATCH 6/6] Update chanterelle-bin.sh --- chanterelle-bin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chanterelle-bin.sh b/chanterelle-bin.sh index c086445..0800f28 100755 --- a/chanterelle-bin.sh +++ b/chanterelle-bin.sh @@ -14,4 +14,4 @@ then exit 1 fi -node -e "console.log(process.argv);require('./output/ChanterelleMain/index.js').main();" -- "chanterelle" $* +node -e "require('./output/ChanterelleMain/index.js').main();" -- "chanterelle" $*