-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test, actually filter on groups
- Loading branch information
1 parent
a5e8f22
commit 38bc3f9
Showing
3 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,4 +96,5 @@ Thumbs.db | |
|
||
# Ignore built ts files | ||
__tests__/runner/* | ||
lib/**/* | ||
lib/**/* | ||
packages.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
import { config as loadEnv } from "dotenv"; | ||
import { readFile, writeFile } from "fs/promises"; | ||
import { GithubPackages } from "../src/github"; | ||
|
||
loadEnv(); | ||
|
||
const matchFileFilters: Array<RegExp> = [ | ||
new RegExp("^compactmachines-(?:[\\d\\.]+){4}.jar$") | ||
]; | ||
|
||
async function run() { | ||
let pkg = await GithubPackages.getPackageInfo("compactmods", "compactmachines", ["dev.compactmods.compactmachines"]); | ||
|
||
console.debug("Latest Version: " + pkg.version); | ||
|
||
let matched = matchFileFilters.length == 0 ? pkg.files : pkg.files.filter(file => { | ||
return matchFileFilters.some(filter => { | ||
let matched = filter.test(file.name); | ||
return matched; | ||
}); | ||
}); | ||
|
||
await writeFile("packages.json", JSON.stringify(matched, undefined, 4)); | ||
} | ||
|
||
run(); |