Skip to content

Commit 4a6b0b7

Browse files
Merge pull request #72 from vinaysharma14/development
Development
2 parents 5a35047 + 34fc94b commit 4a6b0b7

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rapid-react",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "A light weight interactive CLI Automation Tool 🛠️ for rapid scaffolding of React apps with Create React App under the hood. ⚛️",
55
"main": "lib/index.js",
66
"scripts": {

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env node
22
import chalk from 'chalk';
33
import figlet from 'figlet';
4+
import { platform } from 'os';
45

56
import { commands } from './constants';
67
import { run, getFileExtensions } from './utils';
@@ -26,6 +27,7 @@ const init = async () => {
2627
walkThrough,
2728
} = messages;
2829

30+
const winPlatform = platform() === 'win32';
2931
const asciiArt = figlet.textSync(name, { font: 'ANSI Shadow' });
3032

3133
// greetings
@@ -35,7 +37,7 @@ const init = async () => {
3537
await checkUpdate();
3638

3739
console.log(`${welcome}\n`);
38-
features.forEach(value => console.log(`${chalk.green('✔')} ${value}`));
40+
features.forEach(value => console.log(`${chalk.green(winPlatform ? '√' : '✔')} ${value}`));
3941
console.log(`\n${chalk.cyan(walkThrough)}\n`);
4042

4143
try {
@@ -108,7 +110,7 @@ const init = async () => {
108110
console.log(`\n${complete} ${chalk.green(directory)}\n`);
109111
console.log(thanks);
110112
console.log(`${raiseIssue}\n`);
111-
await notify();
113+
await notify(winPlatform);
112114
} catch (error) {
113115
console.error(error.message);
114116
}

src/scripts/notify.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import os from 'os';
21
import { exec } from 'child_process';
32

43
const player = require('play-sound')();
54
const asyncExec = require('util').promisify(exec);
65

7-
export const notify = async() => {
6+
export const notify = async(winPlatform: boolean) => {
87
const assetPath = __dirname.replace('scripts', 'assets/notification.mp3');
98

10-
if (os.platform() === 'win32') {
9+
if (winPlatform) {
1110
// handle audio playback on windows machine explicitly
1211
// code reference has been taken from https://github.com/nomadhoc/sound-play
1312

0 commit comments

Comments
 (0)