Skip to content

Commit 2a6639b

Browse files
Merge pull request #71 from vinaysharma14/fix/check-symbol-windows-fallback
Fix/check symbol windows fallback
2 parents 0458a1c + df6a0b5 commit 2a6639b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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)