Created
May 7, 2013 16:24
-
-
Save hashrock/5533952 to your computer and use it in GitHub Desktop.
フォルダの更新を監視してMakeをキックするJScript
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
fs = new ActiveXObject("Scripting.FileSystemObject"); | |
base = fs.BuildPath(String(WScript.ScriptFullName).replace(WScript.ScriptName,""), "."); | |
objFile = fs.GetFolder(base); | |
a = new Date(objFile.DateLastModified).getTime(); | |
while(true){ | |
WScript.sleep(1000); | |
b = new Date(objFile.DateLastModified).getTime(); | |
if(a != b){ | |
//WScript.echo("ファイルが更新されました" + a +"vs" + b); | |
var sh = new ActiveXObject( "WScript.Shell" ); | |
sh.CurrentDirectory = base; | |
sh.Run('"C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/nmake.exe"',1,true ); | |
a = b; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment