Skip to content

Instantly share code, notes, and snippets.

@hashrock
Created May 7, 2013 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hashrock/5533952 to your computer and use it in GitHub Desktop.
Save hashrock/5533952 to your computer and use it in GitHub Desktop.
フォルダの更新を監視してMakeをキックするJScript
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