-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move installer detection logic to implementation (#126)
- Loading branch information
Showing
11 changed files
with
532 additions
and
217 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,29 @@ | ||
import * as types from "../types"; | ||
|
||
/** | ||
* Provide a path to the pre-bundled (but probably old) Miniconda base installation | ||
* | ||
* ### Note | ||
* This is the "cheapest" provider: if miniconda is already on disk, it can be | ||
* fastest to avoid the download/install and use what's already on the image. | ||
*/ | ||
export const bundledMinicondaUser: types.IInstallerProvider = { | ||
label: "use bundled Miniconda", | ||
provides: async (inputs, options) => { | ||
return ( | ||
inputs.minicondaVersion === "" && | ||
inputs.architecture === "x64" && | ||
inputs.installerUrl === "" | ||
); | ||
}, | ||
installerPath: async (inputs, options) => { | ||
// no-op | ||
return { | ||
localInstallerPath: "", | ||
options: { | ||
...options, | ||
useBundled: true, | ||
}, | ||
}; | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,11 +1,26 @@ | ||
import { ensureLocalInstaller } from "./base"; | ||
import * as types from "../types"; | ||
|
||
import * as base from "./base"; | ||
|
||
/** | ||
* @param url A URL for a file with the CLI of a `constructor`-built artifact | ||
* Provide a path to a `constructor`-compatible installer downloaded from | ||
* any URL, including `file://` URLs. | ||
* | ||
* ### Note | ||
* The entire local URL is used as the cache key. | ||
*/ | ||
export async function downloadCustomInstaller( | ||
inputs: types.IActionInputs | ||
): Promise<string> { | ||
return await ensureLocalInstaller({ url: inputs.installerUrl }); | ||
} | ||
export const urlDownloader: types.IInstallerProvider = { | ||
label: "download a custom installer by URL", | ||
provides: async (inputs, options) => !!inputs.installerUrl, | ||
installerPath: async (inputs, options) => { | ||
return { | ||
localInstallerPath: await base.ensureLocalInstaller({ | ||
url: inputs.installerUrl, | ||
}), | ||
options: { | ||
...options, | ||
useBundled: false, | ||
}, | ||
}; | ||
}, | ||
}; |
Oops, something went wrong.