mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Check for existence before copying
This commit is contained in:
@@ -4,6 +4,9 @@ walkdir = require 'walkdir'
|
||||
|
||||
module.exports = (grunt) ->
|
||||
cp: (source, destination, {filter}={}) ->
|
||||
unless grunt.file.exists(source)
|
||||
grunt.fatal("Cannot copy non-existent #{source.cyan} to #{destination.cyan}")
|
||||
|
||||
try
|
||||
walkdir.sync source, (sourcePath, stats) ->
|
||||
return if filter?.test(sourcePath)
|
||||
|
||||
Reference in New Issue
Block a user