fix(maker): spawn the zip command in the containing directory

ensures the generated zip file does not contain a massive system path
This commit is contained in:
Samuel Attard 2016-12-05 13:39:08 +11:00 коммит произвёл Samuel Attard
Родитель 5a56efb914
Коммит e909a0c4bd
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -7,7 +7,9 @@ import { ensureFile } from '../../util/ensure-output';
const zipPromise = (from, to) =>
new Promise((resolve, reject) => {
const child = spawn('zip', ['-r', '-y', to, from]);
const child = spawn('zip', ['-r', '-y', to, path.basename(from)], {
cwd: path.dirname(from),
});
child.stdout.on('data', () => {});
child.stderr.on('data', () => {});