Skip to content
Merged
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
6 changes: 1 addition & 5 deletions kmake/src/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,14 +903,10 @@ export class Project {
}
}

static async create(directory: string, to: string, platform: string, korefile: string, retro: boolean, veryretro: boolean, option: string) {
static async create(directory: string, to: string, platform: string, korefile: string, retro: boolean, veryretro: boolean, options: any = {}) {
Project.platform = platform;
Project.to = path.resolve(to);
try {
let options: any = {};
if (option) {
options[option] = true;
}
let project = await loadProject(path.resolve(directory), null, options, korefile);
if (retro && project.kore && !project.koreProcessed) {
if (veryretro) {
Expand Down
33 changes: 29 additions & 4 deletions lib/internal/main/run_main_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ let options = [
{
full: 'option',
value: true,
description: 'Pass an option to the kfile',
default: ''
description: 'Pass multiple options to the kfile',
metavar: 'k,k=v',
default: {}
}
];

Expand Down Expand Up @@ -331,7 +332,19 @@ for (let i = 1; i < args.length; ++i) {
found = true;
if (option.value) {
++i;
parsedOptions[option.full] = args[i];
if (option.full == 'option') {
let optionKey = args[i];
let optionValue = option.value;
let optionKeyEqualIndex = optionKey.indexOf("=");
if (optionKeyEqualIndex != -1) {
optionValue = optionKey.substring(optionKeyEqualIndex+1, optionKey.length);
optionKey = optionKey.substring(0, optionKeyEqualIndex);
}
parsedOptions[option.full][optionKey] = optionValue;
}
else {
parsedOptions[option.full] = args[i];
}
}
else {
parsedOptions[option.full] = true;
Expand All @@ -353,7 +366,19 @@ for (let i = 1; i < args.length; ++i) {
found = true;
if (option.value) {
++i;
parsedOptions[option.full] = args[i];
if (option.full == 'option') {
let optionKey = args[i];
let optionValue = option.value;
let optionKeyEqualIndex = optionKey.indexOf("=");
if (optionKeyEqualIndex != -1) {
optionValue = optionKey.substring(optionKeyEqualIndex+1, optionKey.length);
optionKey = optionKey.substring(0, optionKeyEqualIndex);
}
parsedOptions[option.full][optionKey] = optionValue;
}
else {
parsedOptions[option.full] = args[i];
}
}
else {
parsedOptions[option.full] = true;
Expand Down
6 changes: 1 addition & 5 deletions lib/kmake/Project.js

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

Loading
Loading