UNPKG

gulp-execa

Version:

Gulp.js command execution for humans

34 lines (20 loc) 500 B
import renameFn from"rename-fn"; import{execCommand}from"./exec.js"; import{validateInput}from"./input.js"; import{parseOpts}from"./options/main.js"; export const task=(input,opts)=>{ try{ validateInput(input); const optsA=parseOpts({opts}); const gulpTask=execCommand.bind(undefined,input,optsA); renameFn(gulpTask,input); return gulpTask }catch(error){ handleTask(error) } }; const handleTask=(error)=>{ const errorA=new Error(error.message); errorA.stack=error.stack; throw errorA };