Skip to content

Instantly share code, notes, and snippets.

@chrahunt
Last active August 29, 2015 14:08
Show Gist options
  • Save chrahunt/97b70777beb6ae1ebff4 to your computer and use it in GitHub Desktop.
Save chrahunt/97b70777beb6ae1ebff4 to your computer and use it in GitHub Desktop.
@echo off
set extension_name=tagpro-bot-userscript
::Set these if juicer/uglify are not on your path.
set juicer_path=C:\Ruby193\bin\juicer.bat
set uglifyjs_path=%HOME%\AppData\Roaming\npm\uglifyjs.cmd
::Location of your project source files.
set project_src_path=..
::Location of the installed UserScript within Chrome's extension
::directory, including the filename script.js.
set chrome_extension="%HOME%\AppData\Local\Google\Chrome\User Data\Default\Extensions\gefkobiiaofjblpeikhfacinlnmfnpgd\0.1_0\script.js"
::Shouldn't need to touch this.
set juicer_output_path="%project_src_path%\..\%extension_name%.user.js"
set juicer_input_path="%project_src_path%\build\make.js"
where juicer
if %ERRORLEVEL% neq 0 (
set juicer=%juicer_path%
) ELSE (
set juicer=juicer
)
where uglifyjs
if %ERRORLEVEL% neq 0 (
set uglifyjs=%uglifyjs_path%
) ELSE (
set uglifyjs=uglifyjs
)
::Replace backslashes with slash.
set juicer_output_path=%juicer_output_path:\=/%
set juicer_input_path=%juicer_input_path:\=/%
set chrome_extension=%chrome_extension:\=/%
@echo on
::Run commands.
call %juicer% merge --force --ignore-problems -o %juicer_output_path% %juicer_input_path%
call %uglifyjs% %juicer_output_path% --comments all --screw-ie8 true -o %chrome_extension%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment