Skip to content

Commit

Permalink
chore/ci: drop Node.js 12 / drop nunjunks (#124)
Browse files Browse the repository at this point in the history
* chore/ci: drop Node.js 12

* refactor: drop nunjucks

* chore: remove package-lock.json
  • Loading branch information
SukkaW authored Jul 28, 2023
1 parent 18adb33 commit 7290ea4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['12.x', '14.x', '16.x']
node-version: ['14.x', '16.x', '18.x', '20.x']
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -47,4 +47,4 @@ jobs:
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
github-token: ${{ secrets.github_token }}
11 changes: 2 additions & 9 deletions lib/deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
const pathFn = require('path');
const fs = require('hexo-fs');
const { underline } = require('picocolors');
const nunjucks = require('nunjucks');
const moment = require('moment');
const { spawn } = require('hexo-util');

const assetDir = pathFn.join(__dirname, '../assets');

const swigHelpers = {
now: function(format) {
return moment().format(format);
}
};

module.exports = function(args) {
const baseDir = this.base_dir;
const publicDir = this.public_dir;
Expand Down Expand Up @@ -95,6 +88,6 @@ module.exports = function(args) {
};

function commitMessage(args) {
const message = args.m || args.msg || args.message || 'Site updated: {{ now(\'YYYY-MM-DD HH:mm:ss\') }}';
return nunjucks.renderString(message, swigHelpers);
const message = args.m || args.msg || args.message || `Site updated: ${moment().format('YYYY-MM-DD HH:mm:ss')}`;
return message;
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
"hexo-fs": "^4.1.1",
"hexo-util": "^3.1.0",
"moment": "^2.29.1",
"nunjucks": "^3.2.3",
"picocolors": "^1.0.0"
},
"engines": {
"node": ">=12.13.0"
"node": ">=14"
}
}

0 comments on commit 7290ea4

Please sign in to comment.