Skip to content

Commit

Permalink
removing matrices.json
Browse files Browse the repository at this point in the history
  • Loading branch information
crysmags committed Oct 2, 2024
1 parent 6ee768c commit d336692
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- id: plugins
run: |
echo "starting up"
echo node --version
content=$(node ./scripts/create_matrix.js)
echo "matrices=$content" >> $GITHUB_OUTPUT
echo $content
Expand Down
10 changes: 6 additions & 4 deletions scripts/create_matrix.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env node

const { npmView } = require('./helpers/versioning')
const path = require('path')
const fs = require('fs')
const { execSync } = require('child_process')
const yaml = require('js-yaml')

Check failure on line 5 in scripts/create_matrix.js

View workflow job for this annotation

GitHub Actions / lint

'js-yaml' should be listed in the project's dependencies. Run 'npm i -S js-yaml' to add it

const matricesPath = path.join(
Expand Down Expand Up @@ -34,7 +32,7 @@ const pluginsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matric
const versionsJson = require(versionsPath)
const versionsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(versionsPath, 'utf-8')).matrices)

function generateMatrix (name) {
function generateMatrix () {
let versionsPlugin
let matrix

Expand Down Expand Up @@ -79,10 +77,14 @@ function generateMatrix (name) {
matricesJson.matrices[name] = matrix
}
}
fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2))
return matricesJson
}

module.exports = {
generateMatrix
}

if (require.main === module) {
// eslint-disable-next-line no-console
console.log(JSON.stringify(generateMatrix()))
}

0 comments on commit d336692

Please sign in to comment.