Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tools: add update-remark.sh
  • Loading branch information
MylesBorins committed Dec 4, 2017
commit 99484c233145473d4f9a4b8056e5bf8120350d56
48 changes: 48 additions & 0 deletions tools/update-remark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash

# Shell script to update remark in the source tree to the latest release.

# Depends on npm and node being in $PATH.

# This script must be be in the tools directory when it runs because it uses
# $BASH_SOURCE[0] to determine directories to work in.

cd "$( dirname "${BASH_SOURCE[0]}" )"
rm -rf remark-cli
mkdir remark-cli-tmp
cd remark-cli-tmp
npm init --yes

npm install --global-style --no-bin-links --production --no-package-lock remark-cli@latest

cd node_modules/remark-cli
npm dedupe
cd ../..

# Install dmn if it is not in path.
type -P dmn || npm install -g dmn

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this one if dmn has been installed globally in L23?


# Use dmn to remove some unneeded files.
dmn -f clean

cd ..
mv remark-cli-tmp/node_modules/remark-cli remark-cli
rm -rf remark-cli-tmp/

rm -rf remark-preset-lint-node
mkdir remark-preset-lint-node-tmp
cd remark-preset-lint-node-tmp
npm init --yes

npm install --global-style --no-bin-links --production --no-package-lock remark-preset-lint-node@latest

cd node_modules/remark-preset-lint-node
npm dedupe
cd ../..

# Use dmn to remove some unneeded files.
dmn -f clean

cd ..
mv remark-preset-lint-node-tmp/node_modules/remark-preset-lint-node remark-preset-lint-node
rm -rf remark-preset-lint-node-tmp/