-
Notifications
You must be signed in to change notification settings - Fork 6
Watch for changes in the mods folder and rebuild on each change #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
azilvl
wants to merge
19
commits into
MetaIdea:master
Choose a base branch
from
azilvl:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cb7e546
Add gitignore file
azilvl 4d1d2c2
Add files to gitignore
azilvl cc266da
Update MBINCompiler
azilvl a1c4b91
Add ability to watch for changes in the `ModScript` folder
azilvl dad2f00
Ignore generated MBINCompilerDownloader files
azilvl ae7687d
Improve BuildMod's arg system
azilvl a34b363
Fix a bug with args
azilvl 5d60b60
add options.txt
azilvl ba5b29e
Make a wrapper for the builder that uses the `OPTIONS` file to run it
azilvl a6a46e1
Revert mistakenly staged files
azilvl 5c46799
Revert mistakenly staged files
azilvl 30c97db
Fix issues with the watcher
azilvl 504c1fc
Auto generate the options file when its missing
azilvl c2e9ce8
Use BuildMod's OPTIONS.txt reading logic for the watcher
azilvl e2129be
Add comment support for the options file
azilvl 1b365c7
Pause on errors to see them
azilvl 18d951f
Reorder things
azilvl 92dd84c
Prepare to move the builder to MODBUILDER
azilvl 9048ca3
Move the builder to MODBUILDER
azilvl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,33 @@ | ||
NMS_FOLDER.txt* | ||
MODBUILDER/MOD_PAK_SOURCE.txt | ||
MODBUILDER/CurrentModScript.txt | ||
MODBUILDER/input.txt | ||
MODBUILDER/MOD_FILENAME.txt | ||
MODBUILDER/MOD_MBIN_SOURCE.txt | ||
MODBUILDER/THIS_FOLDER_PATH.txt | ||
MODBUILDER/MBINCompilerVersion.txt | ||
MODBUILDER/OnlyOneScript.txt | ||
MODBUILDER/PAK_LIST_CREATED.txt | ||
MODBUILDER/pak_list.txt | ||
Builds/ | ||
CreatedModPAKs/ | ||
EXML_Helper/ | ||
MapFileTrees/ | ||
NMS_pak_list.txtPretty.lua | ||
REPORT.txt | ||
MODBUILDER/COMBINED_CONTENT_LIST.txt | ||
MODBUILDER/DateTime.txt | ||
MODBUILDER/Composite_MOD_FILENAME.txt | ||
MODBUILDER/MASTER_FOLDER_PATH.txt | ||
MODBUILDER/MBIN_PAKS.txt | ||
MODBUILDER/MODS_pak_list.txt | ||
MODBUILDER/pak_listDateTime.txt | ||
MODBUILDER/Times.txt | ||
MODBUILDER/_TEMP/ | ||
MODBUILDER/MOD | ||
MODBUILDER/LuaEndedOk.txt | ||
MODBUILDER/MBINCompiler.log | ||
ModScript/** | ||
!ModScript/empty | ||
ModExtraFilesToInclude/** | ||
!ModExtraFilesToInclude/empty |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains hidden or 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 |
---|---|---|
@@ -1 +1 @@ | ||
https://github.com/monkeyman192/MBINCompiler/releases/download/v2.0.13-pre1/MBINCompiler.exe | ||
https://github.com/monkeyman192/MBINCompiler/releases/download/v2.24.0-pre2/MBINCompiler.exe |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,2 @@ | ||
@echo off | ||
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%cd%\w.ps1'" |
This file contains hidden or 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,49 @@ | ||
# set the arguments to be passed to the builder | ||
$args = "-copy","-recreateMapFileTrees" | ||
function Get-CurrentDirectory { | ||
return Split-Path $MyInvocation.ScriptName | ||
} | ||
$pathToMonitor = Join-Path (Get-CurrentDirectory) "ModScript" | ||
$watcher = New-Object System.IO.FileSystemWatcher | ||
$watcher.Path = $pathToMonitor | ||
$watcher.IncludeSubdirectories = $true | ||
$watcher.EnableRaisingEvents = $true | ||
|
||
$cachedLastWriteTime = [long]([DateTime]::MinValue.Ticks) | ||
|
||
$action = { | ||
$path = $Event.SourceEventArgs.FullPath | ||
$lastWriteTime = [long](Get-ItemProperty -Path $path -Name LastWriteTime).LastWriteTime.Ticks | ||
if (($lastWriteTime - $cachedLastWriteTime ) -gt 100000) { | ||
$changeType = $Event.SourceEventArgs.ChangeType | ||
write-host "`n$(Get-Date -Format HH:mm:ss), $changeType, $path" | ||
$cachedLastWriteTime = $lastWriteTime | ||
Start-Process BuildMod.bat -ArgumentList $args | ||
} | ||
|
||
} | ||
$handlers = . { | ||
Register-ObjectEvent -InputObject $watcher -EventName Changed -Action $Action -SourceIdentifier FSChange | ||
# Register-ObjectEvent -InputObject $watcher -EventName Created -Action $Action -SourceIdentifier FSCreate | ||
# Register-ObjectEvent -InputObject $watcher -EventName Deleted -Action $Action -SourceIdentifier FSDelete | ||
# Register-ObjectEvent -InputObject $watcher -EventName Renamed -Action $Action -SourceIdentifier FSRename | ||
} | ||
|
||
Write-Host "Watching for changes to /ModScript" | ||
|
||
try { | ||
do { | ||
Wait-Event -Timeout 1 | ||
Write-Host "." -NoNewline | ||
|
||
} while ($true) | ||
} | ||
finally { | ||
Unregister-Event -SourceIdentifier FSChange | ||
# Unregister-Event -SourceIdentifier FSCreate | ||
# Unregister-Event -SourceIdentifier FSDelete | ||
# Unregister-Event -SourceIdentifier FSRename | ||
$handlers | Remove-Job | ||
$watcher.EnableRaisingEvents = $false | ||
$watcher.Dispose() | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.