From 5d14457859d8809522f460690894657f29e1bafb Mon Sep 17 00:00:00 2001 From: imomoda Date: Mon, 25 Mar 2024 18:38:31 +0800 Subject: [PATCH 1/2] feat: support create a desktop for link --- api-type-definitions.js | 1 + src/validation.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api-type-definitions.js b/api-type-definitions.js index e230644..0952fd6 100644 --- a/api-type-definitions.js +++ b/api-type-definitions.js @@ -22,6 +22,7 @@ * @property {string} [hotkey] A global hotkey to associate to opening this shortcut, like 'CTRL+ALT+F'. * @property {string} [workingDirectory] The working directory for the shortcut when it launches, must be a valid path to a folder. * @property {string} [VBScriptPath] This is an advanced option specifically and only for projects packaged with `pkg`. + * @property {string} [isLink] This parameter indicates that it is a link or deeplink, It is using either the "http://" or "https://" protocol or a custom deeplink protocol. * [See documentation](https://github.com/nwutils/create-desktop-shortcuts#windows-settings). */ diff --git a/src/validation.js b/src/validation.js index afb7d70..d58d97e 100644 --- a/src/validation.js +++ b/src/validation.js @@ -398,7 +398,9 @@ const validation = { windowsFilePath = helpers.resolveWindowsEnvironmentVariables(windowsFilePath); windowsFilePath = this.resolvePATH(windowsFilePath); } - + if(options.windows.isLink){ + return options; + } if ( !windowsFilePath || typeof(windowsFilePath) !== 'string' || From db605270d4dee2a09fc5cd7a37e1364d10ec7350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E9=97=B4=E8=8D=89=E5=A4=AB?= Date: Tue, 26 Mar 2024 01:44:56 +0800 Subject: [PATCH 2/2] Update src/validation.js Co-authored-by: The Jared Wilcurt --- src/validation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validation.js b/src/validation.js index d58d97e..4c6ee21 100644 --- a/src/validation.js +++ b/src/validation.js @@ -398,7 +398,7 @@ const validation = { windowsFilePath = helpers.resolveWindowsEnvironmentVariables(windowsFilePath); windowsFilePath = this.resolvePATH(windowsFilePath); } - if(options.windows.isLink){ + if (options.windows.isLink) { return options; } if (