Skip to content

Commit

Permalink
chore(deps): Update npm deps, add Node 20 to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Mar 26, 2024
1 parent d4a7c87 commit f9baf95
Show file tree
Hide file tree
Showing 6 changed files with 1,729 additions and 6,111 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [16.x, 18.x, 20.x]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
13 changes: 7 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
under the License.
*/

const fs = require('fs-extra');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');
const tmp = require('tmp');
const npa = require('npm-package-arg');
const globby = require('globby');
Expand Down Expand Up @@ -116,10 +116,10 @@ function cordovaCreate (dest, opts = {}) {
try {
// Copy files from template to project
emit('verbose', 'Copying assets.');
fs.copySync(import_from_path, dir);
fs.cpSync(import_from_path, dir, { recursive: true });
} catch (e) {
if (!dirAlreadyExisted) {
fs.removeSync(dir);
fs.rmSync(dir, { recursive: true, force: true });
}
throw e;
}
Expand All @@ -130,7 +130,7 @@ function cordovaCreate (dest, opts = {}) {
// https://github.com/apache/cordova-discuss/issues/69
globby.sync(['**/gitignore'], { cwd: dir, absolute: true })
.forEach(f =>
fs.moveSync(f, path.join(path.dirname(f), '.gitignore'))
fs.renameSync(f, path.join(path.dirname(f), '.gitignore'))
);

// Write out id, name and version to config.xml
Expand All @@ -154,7 +154,8 @@ function cordovaCreate (dest, opts = {}) {
version: conf.version()
});

fs.writeJsonSync(pkgJsonPath, pkgJson, { spaces: 2 });
const jsonStr = JSON.stringify(pkgJson, null, 2);
fs.writeFileSync(pkgJsonPath, `${jsonStr}\n`, 'utf8');
}
});
}
Expand Down
Loading

0 comments on commit f9baf95

Please sign in to comment.