From 1265a359b178a7e97dc81850d1bd85d9d7437027 Mon Sep 17 00:00:00 2001 From: Paul Barry Date: Thu, 5 Aug 2021 16:47:55 -0400 Subject: [PATCH] Allow for version range output --- publish.js | 16 ++++++++++++++++ tmpl/layout.tmpl | 1 + 2 files changed, 17 insertions(+) diff --git a/publish.js b/publish.js index 9eb1ec37..06660115 100644 --- a/publish.js +++ b/publish.js @@ -611,8 +611,24 @@ exports.publish = function(taffyData, opts, tutorials) { } } + var version = packageInfo.version; + + if (opts.resolution === 'minor') { + version = version.replace(/\.[0-9]+$/, '.x'); + } else if (opts.resolution === 'major') { + version = version.replace(/\.[0-9]+\.[0-9]+$/, '.x.x'); + } + if (packageInfo && packageInfo.name) { + outdir = path.join( outdir, packageInfo.name, (version || '') ); + } fs.mkPath(outdir); + view.module = { + name: packageInfo.name, + version: packageInfo.version, + groupVersion: version + }; + // copy the template's static files to outdir var fromDir = path.join(templatePath, 'static'); var staticFiles = fs.ls(fromDir, 3); diff --git a/tmpl/layout.tmpl b/tmpl/layout.tmpl index 8fb37f4c..3c8c85f2 100644 --- a/tmpl/layout.tmpl +++ b/tmpl/layout.tmpl @@ -44,6 +44,7 @@ +

()