-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified injector class to be more modular
- Loading branch information
1 parent
311016c
commit ec78dcc
Showing
12 changed files
with
176 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export class FileExecutionCommandBuilder { | ||
public static buildWindowsFileExecutionCommand(filePath: string): string { | ||
return `start "" "${filePath}"`; | ||
} | ||
|
||
public static buildMacOsFileExecutionCommand(filePath: string): string { | ||
return `open "${filePath}"`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export class FileLocationExecutionCommandBuilder { | ||
public static buildWindowsLocationExecutionCommand(filePath: string): string { | ||
return `start explorer.exe /select,"${filePath}"`; | ||
} | ||
|
||
public static buildMacOsLocationExecutionCommand(filePath: string): string { | ||
return `open -R "${filePath}"`; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/ts/builders/open-url-with-default-browser-command-builder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export class OpenUrlWithDefaultBrowserCommandBuilder { | ||
public static buildWindowsCommand(url: string): string { | ||
return `start "" "${url}"`; | ||
} | ||
|
||
public static buildMacCommand(url: string): string { | ||
return `open "${url}"`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum StylesheetPath { | ||
Windows = "./build/css/windows.css", | ||
MacOs = "./build/css/mac.css", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { join } from "path"; | ||
|
||
export class TrayIconPathBuilder { | ||
public static buildWindowsTrayIconPath(pathToProjectRoot: string): string { | ||
return join(pathToProjectRoot, "img/icons/win/icon.ico"); | ||
} | ||
|
||
public static buildMacOsTrayIconPath(pathToProjectRoot: string): string { | ||
return join(pathToProjectRoot, "img/icons/mac/ueliTemplate.png"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum DirectorySeparator { | ||
WindowsDirectorySeparator = "\\", | ||
macOsDirectorySeparator = "/", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class FilePathRegex { | ||
public static readonly windowsFilePathRegExp = /^[a-zA-Z]:\\[\\\S|*\S]?.*$/; | ||
public static readonly macOsFilePathRegexp = /^\/$|(^(?=\/)|^\.|^\.\.)(\/(?=[^/\0])[^/\0]+)*\/?$/; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.