diff --git a/src/Common.ts b/src/Common.ts index 3d4cdaf6..043514fe 100644 --- a/src/Common.ts +++ b/src/Common.ts @@ -1,5 +1,5 @@ import {App, Editor, FileSystemAdapter, MarkdownView, normalizePath} from "obsidian"; -import {OperatingSystemName} from "./settings/ShellCommandsPluginSettings"; +import {PlatformId} from "./settings/ShellCommandsPluginSettings"; import {platform} from "os"; export function getVaultAbsolutePath(app: App) { @@ -20,9 +20,10 @@ export function isWindows() { } /** - * This is just a wrapper around platform() in order to cast the type to OperatingSystemName. + * This is just a wrapper around platform() in order to cast the type to PlatformId. + * TODO: Consider renaming this to getPlatformId(). */ -export function getOperatingSystem(): OperatingSystemName { +export function getOperatingSystem(): PlatformId { // @ts-ignore In theory, platform() can return an OS name not included in OperatingSystemName. But as Obsidian // currently does not support anything else than Windows, Mac and Linux (except mobile platforms, but they are // ruled out by the manifest of this plugin), it should be safe to assume that the current OS is one of those diff --git a/src/settings/ShellCommandsPluginSettings.ts b/src/settings/ShellCommandsPluginSettings.ts index e76776ce..9a16b749 100644 --- a/src/settings/ShellCommandsPluginSettings.ts +++ b/src/settings/ShellCommandsPluginSettings.ts @@ -35,7 +35,7 @@ export const DEFAULT_SETTINGS: ShellCommandsPluginSettings = { * * @see NodeJS.Platform */ -export type OperatingSystemName = "darwin" | "linux" | "win32"; +export type PlatformId = "darwin" | "linux" | "win32"; /** * All OSes supported by the Shell commands plugin.