1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-13 09:15:47 +02:00

Move imported files into structured folder for easier handling & tweak syntax

This commit is contained in:
chylex 2018-07-04 06:53:31 +02:00
parent 414f3a1f9d
commit 9e5f676e23
4 changed files with 7 additions and 16 deletions

View File

@ -129,17 +129,13 @@ try{
# Imports # Imports
$delete = New-Object "System.Collections.Generic.HashSet[string]" $importFolder = Join-Path $targetDir "scripts\imports"
foreach($path in $imports){ foreach($path in $imports){
$text = [IO.File]::ReadAllText($path) $text = [IO.File]::ReadAllText($path)
$text = [Regex]::Replace($text, '#import (.*)$', { $text = [Regex]::Replace($text, '#import "(.*)"', {
$importPath = $args[0].Groups[1].Value.Trim() $importPath = Join-Path $importFolder ($args[0].Groups[1].Value.Trim())
$importPath = Join-Path ([IO.Path]::GetDirectoryName($path)) $importPath $importStr = [IO.File]::ReadAllText($importPath).TrimEnd()
$delete.Add($importPath) | Out-Null # this is so fucking stupid
$importStr = [IO.File]::ReadAllText($importPath)
if ($importStr[0] -eq '#'){ if ($importStr[0] -eq '#'){
$importStr = $importStr.Substring($importStr.IndexOf("`n") + 1) $importStr = $importStr.Substring($importStr.IndexOf("`n") + 1)
@ -152,12 +148,7 @@ try{
Write-Host "Resolved" $path.Substring($targetDir.Length) Write-Host "Resolved" $path.Substring($targetDir.Length)
} }
foreach($path in $delete){ [IO.Directory]::Delete($importFolder, $True)
Remove-Item -Path $path
Write-Host "Deleted" $path.Substring($targetDir.Length)
}
Remove-Item -Path (Join-Path $targetDir "scripts\components")
# Finished # Finished

View File

@ -123,5 +123,5 @@
window.TDPF_prioritizeNewestEvent = window.TDGF_prioritizeNewestEvent; window.TDPF_prioritizeNewestEvent = window.TDGF_prioritizeNewestEvent;
window.TDPF_injectMustache = window.TDGF_injectMustache; window.TDPF_injectMustache = window.TDGF_injectMustache;
#import components/plugins.base.js #import "scripts/plugins.base.js"
})(); })();

View File

@ -15,4 +15,4 @@ window.TD_PLUGINS = {
} }
}; };
#import components/plugins.base.js #import "scripts/plugins.base.js"