Skip to content

Commit d2ab218

Browse files
authored
fix(create): Add messaging when done (#83)
## Problem After running the `create` command there's no messaging indicating that the library was successfully created. In fact, the last thing rendered to the screen is the `cp` command that copies over the config files. I actually thought the command was broken and the `cp` had failed. ## Solution Replaced the `cp` command with friendly text that says "Copying repo config files." and more importantly when the creation is completed it says "[repoName] successfully created" if the library name was specified (new lib) or "Repo successfully updated" for an existing repo. Also added an update to the `release` workflow to run the unit tests one more time as a double check to make sure we're not releasing broken code that's merged into `master`.
1 parent 074f495 commit d2ab218

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ jobs:
2222
- name: Install dependencies
2323
run: npm ci
2424

25+
- name: Double check unit tests
26+
run: npm test
27+
env:
28+
CI: true
29+
30+
- name: Double check integration tests
31+
run: npm run integrate
32+
env:
33+
CI: true
34+
2535
- name: Build package
2636
run: npm run build
2737

src/commands/create/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ export default async ({
8888
modes,
8989
})
9090
await replaceRepoNameReferences(sanitizedLibraryName)
91+
92+
// eslint-disable-next-line no-console
93+
console.log(
94+
libraryName
95+
? `DONE! ${libraryName} successfully created.`
96+
: 'DONE! Repo successfully updated.',
97+
)
9198
} catch (error) {
9299
return {
93100
code: error.code || 1,

src/commands/create/init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ git status || echo -e "git init\n" && git init
4040
# Create index file if it doesn't already exist
4141
mkdir -p src/
4242
if [ ! -f "src/index.ts" ]; then
43-
echo -e "Creating src/index.ts file\n"
43+
echo -e "Creating dummy src/index.ts file.\n"
4444
echo -e "// Root index file for the library\n// Export top-level functions here" > src/index.ts
4545
fi
4646

4747
# Copy miscellaneous config and repo files
48+
echo -e "Copying repo config files.\n"
4849
DIRNAME=`dirname $0`
4950
CONFIGS_PATH="$DIRNAME/../../../configs"
50-
echo -e "cp -r $CONFIGS_PATH/. ./"
5151
cp -r $CONFIGS_PATH/. ./

0 commit comments

Comments
 (0)