Skip to content

Commit 8a2ed99

Browse files
committed
fix(terminal): adjust some feature detection on windows
1 parent dcc912d commit 8a2ed99

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/ionic/src/lib/shell.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ERROR_SHELL_COMMAND_NOT_FOUND, LOGGER_LEVELS, ShellCommandError } from
22
import { createProcessEnv, killProcessTree, onBeforeExit } from '@ionic/cli-framework/utils/process';
33
import { ShellCommand, which } from '@ionic/cli-framework/utils/shell';
44
import { combineStreams } from '@ionic/cli-framework/utils/streams';
5+
import { TERMINAL_INFO } from '@ionic/cli-framework/utils/terminal';
56
import chalk from 'chalk';
67
import { ChildProcess, SpawnOptions } from 'child_process';
78
import * as Debug from 'debug';
@@ -171,7 +172,7 @@ export class Shell implements IShell {
171172
* @see https://github.com/ionic-team/ionic-cli/issues/3563#issuecomment-425232005
172173
*/
173174
async resolveCommandPath(command: string, options: SpawnOptions): Promise<string> {
174-
if (process.platform === 'win32') {
175+
if (TERMINAL_INFO.windows) {
175176
try {
176177
return await which(command, { PATH: options.env.PATH });
177178
} catch (e) {

packages/ionic/src/lib/utils/emoji.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// Emoji falback, right now just uses fallback on windows,
2-
// but could expand to be more sophisticated to allow emoji
3-
// on Hyper term on windows, for example.
4-
export const emoji = (x: string, fallback: string) => {
5-
if (process.platform === 'win32') {
1+
import { TERMINAL_INFO } from '@ionic/cli-framework/utils/terminal';
2+
3+
export function emoji(x: string, fallback: string): string {
4+
if (TERMINAL_INFO.windows) {
65
return fallback;
76
}
87

98
return x;
10-
};
9+
}

0 commit comments

Comments
 (0)