Skip to content

Commit

Permalink
improve fetch script
Browse files Browse the repository at this point in the history
  • Loading branch information
GamerGirlandCo committed Jan 17, 2023
1 parent f70c14e commit 1bfac44
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fetch-scripts.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$importReg = "(await )?import\(['`"]\./(?<file>.*)['`"]\)"
$importReg = "(await )?import\(['`"]\./(?<file>.*)['`"]\)|import(?: )?['`"]\./(?<file>.*?)['`"];|import(?: )?\{.*\}(?: )?from(?: )?['`"]\./(?<file>.*)['`"]"
Get-Content ./src/latest/index.*.js | ForEach-Object {
if($_ -match $importReg) {
# Write-Output $_
Expand All @@ -10,3 +10,14 @@ Get-Content ./src/latest/index.*.js | ForEach-Object {
curl -L "https://www.songsterr.com/static/latest/$f" > src/latest/$f
}
}
Get-Content ./src/latest/*.js | ForEach-Object {
if($_ -match $importReg) {
# Write-Output $_
$blip = Select-String $importReg -InputObject $_
# Write-Output -InputObject $blip
$fn = $blip.Matches[0].Groups["file"]
$f = $fn.Value
# Write-Output $fn
curl -L "https://www.songsterr.com/static/latest/$f" > src/latest/$f
}
}

0 comments on commit 1bfac44

Please sign in to comment.