This logic is wrong. By having this code there, it's impossible to add a directory "relatively" to an archive. You need to change this line to:

	child = spawn('zip', ['-r', result, targets.map(function (p) {
		var x = p.indexOf(cwd);
		if (x >= 0) {
			p = p.replace(cwd, '');
			if (/^(\/|\\)/.test(p)) {
				p = p.substring(1);
			}
		}
		if (!p) {
			p = '.';
		}
		return p;
	})[0]], { cwd: cwd });