From 01112b04a4cbc4d5ac7485626752c8ddab6f2a44 Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Wed, 15 May 2013 12:11:52 -0700 Subject: Add a task to build a zip file for the chrome store --- Cakefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Cakefile') diff --git a/Cakefile b/Cakefile index cc9d8d91..21967e71 100644 --- a/Cakefile +++ b/Cakefile @@ -50,6 +50,24 @@ task "clean", "removes any js files which were compiled from coffeescript", -> task "autobuild", "continually rebuild coffeescript files using coffee --watch", -> coffee = spawn "coffee", ["-cw", __dirname] +task "package", "Builds a zip file in preparation submission to the chrome store. Output is in dist/", -> + # To get exec-sync, `npm install exec-sync`. We use this for synchronously executing shell commands. + execSync = require("exec-sync") + + invoke "build" + + execSync "rm -rf dist/vimium" + execSync "mkdir -p dist/vimium" + + blacklist = [".*", "*.coffee", "*.md", "reference", "test_harnesses", "tests", "dist", "git_hooks", + "CREDITS", "node_modules", "MIT-LICENSE.txt", "Cakefile"] + rsyncOptions = [].concat.apply( + ["-r", ".", "dist/vimium"], + blacklist.map((item) -> ["--exclude", "'#{item}'"])) + + execSync "rsync " + rsyncOptions.join(" ") + execSync "cd dist && zip -r vimium.zip vimium" + # This builds a CRX that's distributable outside of the Chrome web store. Is this used by folks who fork # Vimium and want to distribute their fork? task "package-custom-crx", "build .crx file", -> -- cgit v1.2.3