Skip to content

Commit

Permalink
attempt to fix cross-platform with windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
yairchu committed Oct 5, 2018
1 parent 07fe4e0 commit 3635e2f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import System.Directory
import System.FilePath ((</>))

nodeRelPath :: FilePath
#ifdef mingw32_HOST_OS
nodeRelPath = "bin/node.exe"
#else
nodeRelPath = "bin/node"
#endif

buildNode :: Verbosity -> IO ()
buildNode verbosity =
Expand Down
4 changes: 2 additions & 2 deletions build_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VER=$(version "$NODE_VERSION")
if [[ $(version "v6.2.1") -le $VER && $VER -lt $(version "v8.0.0") ]]; then
# According to http://node.green/ support of tail calls exists in these versions
echo "Using existing system node $NODE_VERSION"
cp "$(which node)" bin/node
cp "$(which node)" bin/node.exe
else
echo "Building nodejs from source"
# node not available or too old. Build from source.
Expand All @@ -20,5 +20,5 @@ else
./configure --prefix=/tmp
make -j4
cd ..
cp node/node bin/node
cp node/node bin/node.exe
fi
1 change: 0 additions & 1 deletion nodejs-exec.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ cabal-version: >=1.10
-- list all options and get a few harmless warnings :-(
data-files:
bin/node.exe
bin/node
custom-setup
setup-depends:
base, Cabal, directory, filepath
Expand Down
2 changes: 1 addition & 1 deletion src/System/NodeJS/Path.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module System.NodeJS.Path
import Paths_nodejs_exec (getDataFileName)

path :: IO FilePath
path = getDataFileName "bin/node"
path = getDataFileName "bin/node.exe"

0 comments on commit 3635e2f

Please sign in to comment.