padavan 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/main.mjs +2 -1
  2. package/package.json +1 -1
package/main.mjs CHANGED
@@ -246,7 +246,8 @@ export class Padavan {
246
246
  if (!id)
247
247
  id = (await this.getArtifact())?.id;
248
248
  return this.github(`actions/artifacts/${id}/zip`).then(res => res.arrayBuffer()).then(jszip.loadAsync).then(zip => {
249
- const [ firmware, config ] = Object.values(zip.files);
249
+ const regexp = new RegExp('(bin|trx)$');
250
+ const firmware = Object.values(zip.files).find(file => regexp.test(file.name));
250
251
  return firmware.async('blob').then(blob => {
251
252
  const data = new FormData();
252
253
  data.append('file', blob, firmware.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "padavan",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Router management with Padavan firmware",
5
5
  "main": "main.mjs",
6
6
  "files": [