File tree Expand file tree Collapse file tree
tsunami/frontend/src/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Copyright 2025, Command Line Inc.
2+ // SPDX-License-Identifier: Apache-2.0
3+
14export const PlatformMacOS = "darwin" ;
25export const PlatformWindows = "win32" ;
36export let PLATFORM : NodeJS . Platform = PlatformMacOS ;
@@ -20,7 +23,7 @@ export function makeNativeLabel(isDirectory: boolean) {
2023 managerName = "Default Application" ;
2124 } else if ( PLATFORM === PlatformMacOS ) {
2225 managerName = "Finder" ;
23- } else if ( PLATFORM == "win32" ) {
26+ } else if ( PLATFORM == PlatformWindows ) {
2427 managerName = "Explorer" ;
2528 } else {
2629 managerName = "File Manager" ;
Original file line number Diff line number Diff line change 22// SPDX-License-Identifier: Apache-2.0
33
44export const PlatformMacOS = "darwin" ;
5+ export const PlatformWindows = "win32" ;
56export let PLATFORM : NodeJS . Platform = PlatformMacOS ;
67
78export function setPlatform ( platform : NodeJS . Platform ) {
89 PLATFORM = platform ;
910}
1011
11- export function makeNativeLabel ( isDirectory : boolean ) {
12- let managerName : string ;
13- if ( ! isDirectory ) {
14- managerName = "Default Application" ;
15- } else if ( PLATFORM === PlatformMacOS ) {
16- managerName = "Finder" ;
17- } else if ( PLATFORM == "win32" ) {
18- managerName = "Explorer" ;
19- } else {
20- managerName = "File Manager" ;
21- }
12+ export function isMacOS ( ) : boolean {
13+ return PLATFORM == PlatformMacOS ;
14+ }
2215
23- let fileAction : string ;
24- if ( isDirectory ) {
25- fileAction = "Reveal" ;
26- } else {
27- fileAction = "Open File" ;
28- }
29- return `${ fileAction } in ${ managerName } ` ;
16+ export function isWindows ( ) : boolean {
17+ return PLATFORM == PlatformWindows ;
3018}
You can’t perform that action at this time.
0 commit comments