Skip to content

Commit

Permalink
fix: Fix bundling, install script and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed May 21, 2019
1 parent 0112d02 commit 1f52c8a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Or, if you'd prefer to do things manually, download `convert-macos-x64.tar.gz` f

```bash
tar xvf convert-macos-x64.tar.gz
sudo mv -f convert /usr/local/bin # or wherever you like
sudo mv -f stencila-convert /usr/local/bin # or wherever you like
```

#### Linux
Expand All @@ -128,7 +128,7 @@ Or, if you'd prefer to do things manually, or place Convert elsewhere, download

```bash
tar xvf convert-linux-x64.tar.gz
mv -f convert ~/.local/bin/ # or wherever you like
mv -f stencila-convert ~/.local/bin/ # or wherever you like
```

### Package
Expand Down
17 changes: 13 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [[ "$OS" == "Linux" || "$OS" == "Darwin" ]]; then
else
VERSION=$1
fi
INSTALL_PATH="$HOME/.local/bin/"
INSTALL_PATH="$HOME/.local/bin"
;;
'Darwin')
PLATFORM="macos-x64"
Expand All @@ -21,14 +21,23 @@ if [[ "$OS" == "Linux" || "$OS" == "Darwin" ]]; then
else
VERSION=$1
fi
INSTALL_PATH="/usr/local/bin/"
INSTALL_PATH="/usr/local/bin"
;;
esac

echo "Downloading stencila-convert $VERSION"
curl -Lo /tmp/convert.tar.gz https://github.com/stencila/convert/releases/download/$VERSION/convert-$PLATFORM.tar.gz
tar xvf /tmp/convert.tar.gz
mkdir -p $INSTALL_PATH
mv -f stencila-convert $INSTALL_PATH
rm -f /tmp/convert.tar.gz

echo "Installing stencila-convert to $INSTALL_PATH/stencila-convert-$VERSION"
mkdir -p $INSTALL_PATH/stencila-convert-$VERSION
mv -f stencila-convert $INSTALL_PATH/stencila-convert-$VERSION
# Unpack `node_modules` etc into the $INSTALL_PATH/convert-$VERSION
$INSTALL_PATH/stencila-convert-$VERSION/stencila-convert --version

echo "Pointing stencila-convert to $INSTALL_PATH/convert-$VERSION/convert"
ln -sf stencila-convert-$VERSION/stencila-convert $INSTALL_PATH/stencila-convert
else
echo "Sorry, I don't know how to install on this OS, please see https://github.com/stencila/convert#install"
fi
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"build:dist": "tsc && cp src/*.js dist/",
"build:tgz": "tar czf convert-deps.tgz src vendor node_modules/puppeteer/.local-chromium",
"build:bin": "pkg --target=host -o=bin/stencila-convert .",
"bundle:linux": "tar -czvf bin/convert-linux-x64.tar.gz bin/stencila-convert",
"bundle:osx": "tar -czvf bin/convert-macos-x64.tar.gz bin/stencila-convert",
"bundle:linux": "tar -czvf bin/convert-linux-x64.tar.gz -C bin stencila-convert",
"bundle:osx": "tar -czvf bin/convert-macos-x64.tar.gz -C bin stencila-convert",
"bundle:windows": "./bundle-win.sh",
"docs": "markdown-toc -i --maxdepth=4 README.md && typedoc --options typedoc.js ./src",
"clean": "rm -rf bins coverage dist docs tests/**/*.to.* vendor"
Expand Down

0 comments on commit 1f52c8a

Please sign in to comment.