@datkt/konanc-config
Advanced tools
Comparing version 3.0.2 to 3.1.0
15
index.js
@@ -17,2 +17,4 @@ const { extname, dirname, resolve } = require('path') | ||
const config = '.kc' == extname(name) ? name : `${name}.kc` | ||
const cwd = process.cwd() | ||
if (!env || 'object' != typeof env) { | ||
@@ -32,3 +34,5 @@ env = {} | ||
if (!PROTOCOL_REGEX.test(conf.repo)) { | ||
conf.repo = resolve(dirname(config), conf.repo) | ||
conf.repo = [ resolve(dirname(config), conf.repo) ] | ||
} else { | ||
conf.repo = [ conf.repo ] | ||
} | ||
@@ -38,2 +42,11 @@ } | ||
if (Array.isArray(conf.repo)) { | ||
for (const repo of conf.repo) { | ||
if ('string' == typeof repo && !PROTOCOL_REGEX.test(repo)) { | ||
const path = resolve(cwd, repo) | ||
if (!conf.repo.includes(path)) { | ||
conf.repo.push(path) | ||
} | ||
} | ||
} | ||
conf.repo = conf.repo.map((repo) => { | ||
@@ -40,0 +53,0 @@ if ('string' == typeof repo && !PROTOCOL_REGEX.test(repo)) { |
{ | ||
"name": "@datkt/konanc-config", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "Command line utility to read '*.kc' konanc config files to print compiler flags", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
10825
117