File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
import chalk from 'chalk' ;
3
3
import figlet from 'figlet' ;
4
+ import { platform } from 'os' ;
4
5
5
6
import { commands } from './constants' ;
6
7
import { run , getFileExtensions } from './utils' ;
@@ -26,6 +27,7 @@ const init = async () => {
26
27
walkThrough,
27
28
} = messages ;
28
29
30
+ const winPlatform = platform ( ) === 'win32' ;
29
31
const asciiArt = figlet . textSync ( name , { font : 'ANSI Shadow' } ) ;
30
32
31
33
// greetings
@@ -35,7 +37,7 @@ const init = async () => {
35
37
await checkUpdate ( ) ;
36
38
37
39
console . log ( `${ welcome } \n` ) ;
38
- features . forEach ( value => console . log ( `${ chalk . green ( '✔' ) } ${ value } ` ) ) ;
40
+ features . forEach ( value => console . log ( `${ chalk . green ( winPlatform ? '√' : '✔' ) } ${ value } ` ) ) ;
39
41
console . log ( `\n${ chalk . cyan ( walkThrough ) } \n` ) ;
40
42
41
43
try {
@@ -108,7 +110,7 @@ const init = async () => {
108
110
console . log ( `\n${ complete } ${ chalk . green ( directory ) } \n` ) ;
109
111
console . log ( thanks ) ;
110
112
console . log ( `${ raiseIssue } \n` ) ;
111
- await notify ( ) ;
113
+ await notify ( winPlatform ) ;
112
114
} catch ( error ) {
113
115
console . error ( error . message ) ;
114
116
}
Original file line number Diff line number Diff line change 1
- import os from 'os' ;
2
1
import { exec } from 'child_process' ;
3
2
4
3
const player = require ( 'play-sound' ) ( ) ;
5
4
const asyncExec = require ( 'util' ) . promisify ( exec ) ;
6
5
7
- export const notify = async ( ) => {
6
+ export const notify = async ( winPlatform : boolean ) => {
8
7
const assetPath = __dirname . replace ( 'scripts' , 'assets/notification.mp3' ) ;
9
8
10
- if ( os . platform ( ) === 'win32' ) {
9
+ if ( winPlatform ) {
11
10
// handle audio playback on windows machine explicitly
12
11
// code reference has been taken from https://github.com/nomadhoc/sound-play
13
12
You can’t perform that action at this time.
0 commit comments