cloudcannon-hugo
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "cloudcannon-hugo", | ||
"type": "module", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Generates the files necessary for a hugo site to integrate with CloudCannon CMS", | ||
@@ -6,0 +6,0 @@ "main": "src/index.js", |
@@ -11,7 +11,10 @@ import Papa from 'papaparse'; | ||
async function getHugoUrls() { | ||
async function getHugoUrls(hugoConfig) { | ||
log('⏳ Listing files from Hugo...'); | ||
const { source } = pathHelper.getPaths(); | ||
const cmdArgs = ['list', 'all', ...(source ? ['--source', source] : [])]; | ||
const { environment } = hugoConfig; | ||
const cmdArgs = ['list', 'all', '--environment', environment || 'production']; | ||
cmdArgs.push(...(source ? ['--source', source] : [])); | ||
const raw = await runProcess('hugo', cmdArgs); | ||
@@ -34,3 +37,3 @@ const startIndex = raw.search(/^path,/m); // hugo logs warnings before this point | ||
const config = await getConfig(hugoConfig); | ||
const hugoUrls = await getHugoUrls(); | ||
const hugoUrls = await getHugoUrls(hugoConfig); | ||
@@ -37,0 +40,0 @@ pathHelper.getSupportedLanguages(hugoConfig); |
@@ -31,3 +31,3 @@ import { join, extname, basename } from 'path'; | ||
const sourceDir = flags.source || ''; | ||
const environment = flags.environment || 'production'; // or just use root | ||
const environment = flags.environment || process.env.HUGO_ENVIRONMENT || 'production'; | ||
@@ -126,2 +126,6 @@ const configDir = flags.configDir || 'config'; | ||
if (flags.environment) { | ||
configObject.environment = flags.environment; | ||
} | ||
if (flags.destination) { | ||
@@ -128,0 +132,0 @@ configObject.destination = flags.destination; |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
41984
1077
6