Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,28 @@ const { join, resolve } = require("path");
const projectDir = argv["p"] || argv["project"] || argv["in"] || "./game.json";
const outputDir = argv["o"] || argv["out"] || "./dist";
const buildType = argv["build"] || argv["b"];
const gdevelopVersion =
argv["version"] || argv["tag"] || argv["v"] || argv["t"];
const options = { buildType, gdevelopVersion, verbose: argv["verbose"] };
const loadGDOptions = (() => {
const loadGdOptions = {
versionTag: argv["version"] || argv["tag"] || argv["v"] || argv["t"],
user: argv["user"] || argv["u"],
authToken: argv["authToken"] || argv["gitToken"] || argv["token"],
};
const useReleaseAssets = argv["useReleaseAssets"] || argv["useRelease"];
const libGDPath = argv["authToken"] || argv["gitToken"] || argv["token"];

if (useReleaseAssets) {
loadGdOptions.fetchProvider = { useReleaseAssets };
} else if (libGDPath) {
loadGdOptions.fetchProvider = { libGDPath };
}

return Object.keys(loadGdOptions).length ? loadGdOptions : null;
})();
const options = { buildType, verbose: argv["verbose"] };

if (loadGDOptions) {
options.loadGDOptions = loadGDOptions
}

const configPath = join(process.cwd(), "gdexport.config.js");
try {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const pluginTools = require("./plugins");
* @typedef Options The options accepted by the exporter.
* @property {"electron" | "cordova" | "facebook"} [buildType] The build type (defaults to HTML5).
* @property {string} [gdevelopVersion] The version of GDevelop to use for exporting.
* @property {import("gdcore-tools").LoadGDOptions} [loadGDOptions] Advanced GDevelop version configuration to use for exporting.
* @property {Array<import("./plugins").PluginDescriptor>} [plugins] A list of plugins to run.
* @property {boolean} verbose True if messages from GDCore should be logged.
*/
Expand All @@ -20,7 +21,7 @@ module.exports = async (projectPath, outputDir, options) => {
options?.plugins?.forEach(pluginTools.registerPlugin);

console.info("⌛ Loading GDCore...");
const gd = await loadGD(options?.gdevelopVersion);
const gd = await loadGD(options?.gdevelopVersion || options?.loadGDOptions);
if (options?.verbose)
gd.on("print", (message) => console.log("ℹ️ [GDCore] " + message));
gd.on("error", (message) => console.error("❌ [GDCore] " + message));
Expand Down