From 27cedd4690896edeff9b2b2ba2fda157521d6d29 Mon Sep 17 00:00:00 2001 From: Dale Sande Date: Tue, 29 Jun 2021 10:55:50 -0700 Subject: [PATCH] fix(migration): update --no-demo scenario #161 --- util/auroMigrate.md | 14 ++++++++++---- util/auroMigrate.sh | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/util/auroMigrate.md b/util/auroMigrate.md index 1932ca61..fc7cde2a 100644 --- a/util/auroMigrate.md +++ b/util/auroMigrate.md @@ -79,16 +79,22 @@ This function takes up to three arguments in this order: 1. Path to the newly created directory `{ String }` 1. `--no-demo` flag `{ Boolean }` -For example. Migrating from a legacy repo, `flight`, assuming that both repos are in the same root directory, and the new repo is named `auro-flight`, the command would be the following: +For obvious reasons, you cannot have two directories named the same. The migration command accepts any directory path, e.g. if the newly creates repo was in a sub-directory from where the legacy repo is, the command could be the following: ``` -$ auroMigrate flight auro-flight +$ auroMigrate auro-flight migration/auro-flight ``` -If you **do not** intend to migrate the `./demo` directory, add the `--no-demo` flag. +Or if the new repo was outside the current directory ``` -$ auroMigrate flight auro-flight --no-demo +$ auroMigrate auro-flight ../auro-flight +``` + +If the repo you are migrating from does not have a modern markdown demo in the `./demo` directory, please add the `--no-demo` flag. + +``` +$ auroMigrate auroMigrate auro-flight migration/auro-flight --no-demo ``` ## Review and test the migration diff --git a/util/auroMigrate.sh b/util/auroMigrate.sh index f5cea434..a508e3c2 100644 --- a/util/auroMigrate.sh +++ b/util/auroMigrate.sh @@ -49,7 +49,8 @@ function auroMigrate { # check for --no-demo if [[ $3 = "--no-demo" ]]; then - echo -e "${RED}7.${NC} ./demo directory was ${RED}NOT${NC} copied\n" + command cp "$1"/demo/index.html "$2"/demo/index.legacy + echo -e "${RED}7.${NC} the file ${RED}`$1/demo/index.html`${NC} was moved to ${RED}`$2/demo/index.legacy${NC}`\n" sleep 3 else command cp "$1"/demo/demo.md "$2"/demo/demo.md