Skip to content

Instantly share code, notes, and snippets.

@gastaldi
Last active November 28, 2018 14:10
Show Gist options
  • Save gastaldi/5954a9d65bfff0fe83b9ced555862482 to your computer and use it in GitHub Desktop.
Save gastaldi/5954a9d65bfff0fe83b9ced555862482 to your computer and use it in GitHub Desktop.
Convert all dependencies to exact version in package.json
#!/bin/bash
# Requires jq and yarn
for row in $(cat package.json | jq '.dependencies'| jq 'keys[]' -r); do
yarn add ${row} -W --exact
done
for row in $(cat package.json | jq '.devDependencies'| jq 'keys[]' -r); do
yarn add ${row} -W --exact -D
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment