Skip to content

Commit 74f0bbe

Browse files
committed
feat: enable skipping creation of a license file
1 parent 5b1c7c3 commit 74f0bbe

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

local.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ function main(o, config, configName, callback) {
9797
}
9898
}
9999
}
100-
if (config.apache) {
101-
ff.createFile(path.join(outputDir,subDir,'LICENSE'),ff.readFileSync(tpl({}, '_common', 'LICENSE'),'utf8'),'utf8');
100+
101+
// generate license by default
102+
if (typeof config.license === 'undefined') {
103+
config.license = true;
102104
}
103-
else {
104-
ff.createFile(path.join(outputDir,subDir,'LICENSE'),ff.readFileSync(tpl({}, '_common', 'UNLICENSE'),'utf8'),'utf8');
105+
106+
if (config.license) {
107+
const licenseType = config.apache ? 'LICENSE' : 'UNLICENSE';
108+
ff.createFile(path.join(outputDir, subDir, 'LICENSE'), ff.readFileSync(tpl({}, '_common', licenseType), 'utf8'), 'utf8');
105109
}
110+
106111
let outer = model;
107112

108113
if (config.perApi) {

schemas/config.json

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"type": "string",
1515
"description": "Name of the config. Currently unused."
1616
},
17+
"license": {
18+
"type": "boolean",
19+
"description": "Whether to create a license file"
20+
},
1721
"apache": {
1822
"type": "boolean",
1923
"description": "Whether to include the Apache-2.0 license instead of the Unlicense"

0 commit comments

Comments
 (0)