@antora/site-publisher
Advanced tools
Comparing version 1.0.0-rc.2 to 1.0.0
@@ -11,6 +11,8 @@ 'use strict' | ||
function publishToArchive (config, files, playbook) { | ||
const destFile = expandPath(config.path || DEFAULT_DEST_ARCHIVE, '~+', playbook.dir || '.') | ||
return publishStream(vzipDest(destFile), files) | ||
const destFile = config.path || DEFAULT_DEST_ARCHIVE | ||
const absDestFile = expandPath(destFile, '~+', playbook.dir || '.') | ||
const report = { provider: 'archive', path: destFile, resolvedPath: absDestFile } | ||
return publishStream(vzipDest(absDestFile), files).then(() => report) | ||
} | ||
module.exports = publishToArchive |
@@ -5,2 +5,4 @@ 'use strict' | ||
const fs = require('fs-extra') | ||
const ospath = require('path') | ||
const posixify = ospath.sep === '\\' ? (p) => p.replace(/\\/g, '/') : undefined | ||
const publishStream = require('./common/publish-stream') | ||
@@ -12,8 +14,18 @@ const { dest: vfsDest } = require('vinyl-fs') | ||
function publishToFs (config, files, playbook) { | ||
const destDir = expandPath(config.path || DEFAULT_DEST_FS, '~+', playbook.dir || '.') | ||
const destDir = config.path || DEFAULT_DEST_FS | ||
const absDestDir = expandPath(destDir, '~+', playbook.dir || '.') | ||
const report = { | ||
provider: 'fs', | ||
path: destDir, | ||
resolvedPath: absDestDir, | ||
fileUri: 'file://' + (posixify ? '/' + posixify(absDestDir) : absDestDir), | ||
} | ||
return config.clean | ||
? fs.remove(destDir).then(() => publishStream(vfsDest(destDir), files)) | ||
: publishStream(vfsDest(destDir), files) | ||
? fs | ||
.remove(absDestDir) | ||
.then(() => publishStream(vfsDest(absDestDir), files)) | ||
.then(() => report) | ||
: publishStream(vfsDest(absDestDir), files).then(() => report) | ||
} | ||
module.exports = publishToFs |
@@ -44,3 +44,3 @@ 'use strict' | ||
if (!destinations.length) return | ||
if (!destinations.length) return [] | ||
@@ -71,5 +71,3 @@ const clean = output.clean | ||
return Promise.all(publishers.map((publish) => publish(new ReadableOutputFileArray(files), playbook))).then( | ||
() => undefined | ||
) | ||
return Promise.all(publishers.map((publish) => publish(new ReadableOutputFileArray(files), playbook))) | ||
} | ||
@@ -76,0 +74,0 @@ |
@@ -5,3 +5,3 @@ 'use strict' | ||
const DOT_RELATIVE_RX = new RegExp(`^\\.{1,2}[${[...new Set(['/', ospath.sep])].join('').replace('\\', '\\\\')}]`) | ||
const DOT_RELATIVE_RX = new RegExp(`^\\.{1,2}[/${ospath.sep.replace('/', '').replace('\\', '\\\\')}]`) | ||
@@ -8,0 +8,0 @@ /** |
{ | ||
"name": "@antora/site-publisher", | ||
"version": "1.0.0-rc.2", | ||
"version": "1.0.0", | ||
"description": "Publishes the files generated in an Antora documentation pipeline to the destination(s) specified in the playbook.", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
11475
238
0