1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-28 23:06:37 +01:00
metamask-extension/development/rollback.sh

36 lines
866 B
Bash
Raw Normal View History

#! /bin/bash
[[ -z "$1" ]] && { echo "Rollback version is required!" ; exit 1; }
echo "Rolling back to version $1"
# Checkout branch to increment version
git checkout -b version-increment-$1
Switch from `npm` to `yarn` (#6843) As a solution to the constant lockfile churn issues we've had with `npm`, the project now uses `yarn` to manage dependencies. The `package-lock.json` file has been replaced with `yarn.lock`, which was created using `yarn import`. It should approximate the contents of `package-lock.json` fairly well, though there may be some changes due to deduplication. The codeowners file has been updated to reference this new lockfile. All documentation and npm scripts have been updated to reference `yarn` rather than `npm`. Note that running scripts using `npm run` still works fine, but it seemed better to switch those to `yarn` as well to avoid confusion. The `npm-audit` Bash script has been replaced with `yarn-audit`. The output of `yarn audit` is a bit different than `npm audit` in that it returns a bitmask to describe which severity issues were found. This made it simpler to check the results directly from the Bash script, so the associated `npm-audit-check.js` script was no longer required. The output should be exactly the same, and the information is still sourced from the same place (the npm registry). The new `yarn-audit` script does have an external dependency: `jq`. However, `jq` is already assumed to be present by another CI script, and is present on all CI images we use. `jq` was not added to `package.json` as a dependency because there is no official package on the npm registry, just wrapper scripts. We don't need it anywhere exept on CI anyway. The section in `CONTRIBUTING` about how to develop inside the `node_modules` folder was removed, as the advice was a bit dated, and wasn't specific to this project anyway.
2019-07-30 20:36:23 +02:00
yarn version:bump patch
# Store the new version name
NEW_VERSION=$(cat app/manifest.json | jq -r .version)
# Make sure origin tags are loaded
git fetch origin
# check out the rollback branch
git checkout origin/v$1
# Create the rollback branch.
git checkout -b Version-$NEW_VERSION-Rollback-to-$1
# Set the version files to the next one.
git checkout master CHANGELOG.md
git checkout master app/manifest.json
git commit -m "Version $NEW_VERSION (Rollback to $1)"
# Push the new branch to PR
git push -u origin HEAD
# Create tag and push that up too
git tag v${NEW_VERSION}
git push origin v${NEW_VERSION}
# Cleanup version branch
git branch -D version-increment-$1