Skip to content

Commit

Permalink
fix(husky migration): update scripts to address husky init
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfalcon authored and AuroDesignSystem committed Jun 2, 2021
1 parent 9050a59 commit 5505716
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion util/auroMigrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ To install the script, run the following command:
curl https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/util/auroMigrate.sh -o ~/.auroMigrate.sh
```

Even if you have installed this before, it's good to reinstall to ensure you have the latest version.

The next step is to add a reference to this file in either your `~/.bash_profile` or `~/.bashrc` file.

```
Expand Down Expand Up @@ -46,8 +48,10 @@ First step to performing the migration is to create a new repository from the Au

If you are creating a new element repo in the same directory as the legacy repo, it is recommended that you **rename the legacy repo** BEFORE you runt he generator as not to cause a collision.

Use the optional namespace argument if you do not want `@aurodesignsystem`. Use this option with `@aurolabs` if you are migrating an auroLabs repo.

```
$ generateRepo [element-name]
$ generateRepo [element-name] [optional npm namespace]
```

## What to expect
Expand Down
12 changes: 10 additions & 2 deletions util/auroMigrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Generate a new baseline install of an auro component
# Argument expected: name of new repo
function generateRepo {
command wc-generate --test --name "$1"
command wc-generate --test --name "$1" --npm "$2"
}

## Migrade files from legacy repo to new build
Expand Down Expand Up @@ -64,8 +64,16 @@ function auroMigrate {
sleep 2
fi

# Initalize Husky
command npx husky-init
command cat .husky/pre-commit.temp > .husky/pre-commit
command rm .husky/pre-commit.temp
echo -e "Husky successfully configured! \n"
sleep 2

# create and switch to new repoUpgrade branch
command git checkout -b repoUpgrade
echo -e "New ${GREEN}'repoUpgrade'${NC} branch created \n"
sleep 3

# add updates
Expand All @@ -78,6 +86,6 @@ function auroMigrate {

# close out message
echo -e "\n\nCommitted all changes to ${YELLOW}repoUpgrde${NC} Git branch\n"
echo -e "For any subsequent changes to the ${YELLOW}repoUpgrde${NC}, please\nbe sure to amend to previous commit.\n"
echo -e "For any subsequent changes to the ${YELLOW}repoUpgrde${NC}, please\nbe sure to amend to the previous commit.\n"
echo -e "Use ${YELLOW}$ git commit --amend --no-edit${NC} after staging the updates.\n\n"
}
2 changes: 1 addition & 1 deletion util/help-outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const generate = `
v${pjson.version}
${chalk.gray('Upgrade to latest version:')}
$ npm i @alaskaairux/wc-generator@latest -g
$ npm i @aurodesignsystem/wc-generator@latest -g
${chalk.gray('Options:')}
Expand Down

0 comments on commit 5505716

Please sign in to comment.