mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-04-27 02:18:27 -04:00
print Hugo version & environment variables in tests
This commit is contained in:
parent
8dac927afa
commit
a0a61c0d60
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@ -19,8 +19,6 @@ jobs:
|
|||||||
npm test
|
npm test
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
- name: Check Hugo version
|
|
||||||
run: node cli.js env
|
|
||||||
- name: Publish!
|
- name: Publish!
|
||||||
run: npm publish --access public
|
run: npm publish --access public
|
||||||
env:
|
env:
|
||||||
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -22,5 +22,3 @@ jobs:
|
|||||||
npm test
|
npm test
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
- name: Check Hugo version
|
|
||||||
run: node cli.js env
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const BinWrapper = require('bin-wrapper');
|
const binWrapper = require('bin-wrapper');
|
||||||
const { hugoVersion } = require('../package.json');
|
const { hugoVersion } = require('../package.json');
|
||||||
|
|
||||||
const baseUrl = `https://github.com/gohugoio/hugo/releases/download/v${hugoVersion}/`;
|
const baseUrl = `https://github.com/gohugoio/hugo/releases/download/v${hugoVersion}/`;
|
||||||
|
|
||||||
// Default to extended Hugo, fall back to vanilla Hugo on unsupported platforms
|
// Default to extended Hugo, fall back to vanilla Hugo on unsupported platforms
|
||||||
const extendedBin = new BinWrapper()
|
const extendedBin = new binWrapper()
|
||||||
.src(`${baseUrl}hugo_extended_${hugoVersion}_Linux-64bit.tar.gz`, 'linux', 'x64')
|
.src(`${baseUrl}hugo_extended_${hugoVersion}_Linux-64bit.tar.gz`, 'linux', 'x64')
|
||||||
.src(`${baseUrl}hugo_extended_${hugoVersion}_macOS-64bit.tar.gz`, 'darwin', 'x64')
|
.src(`${baseUrl}hugo_extended_${hugoVersion}_macOS-64bit.tar.gz`, 'darwin', 'x64')
|
||||||
.src(`${baseUrl}hugo_extended_${hugoVersion}_Windows-64bit.zip`, 'win32', 'x64')
|
.src(`${baseUrl}hugo_extended_${hugoVersion}_Windows-64bit.zip`, 'win32', 'x64')
|
||||||
|
@ -5,11 +5,18 @@
|
|||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const binCheck = require('bin-check');
|
const binCheck = require('bin-check');
|
||||||
const hugoBin = require('..');
|
const hugoBin = require('..');
|
||||||
|
const { execFile } = require('child_process');
|
||||||
|
|
||||||
describe('hugo-bin', () => {
|
it('Hugo exists and runs?', () => {
|
||||||
it('should return path to binary and work', () => {
|
return binCheck(hugoBin, ['version']).then(works => {
|
||||||
return binCheck(hugoBin, ['version']).then(works => {
|
assert(works);
|
||||||
assert(works);
|
|
||||||
});
|
// Print additional build environment variables if check successful
|
||||||
|
if (works) {
|
||||||
|
execFile(hugoBin, ['env'], (error, stdout) => {
|
||||||
|
if (error) throw error;
|
||||||
|
console.log(stdout);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user