From cc124be849a1c18b14a14d3d05400572799ea33d Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Mon, 25 Apr 2016 16:18:23 -0700 Subject: [PATCH] fix(build): fix lstatSync throwing --- build/tasks/add-nylas-build-resources-task.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/tasks/add-nylas-build-resources-task.coffee b/build/tasks/add-nylas-build-resources-task.coffee index 0ca009845..36eb3d944 100644 --- a/build/tasks/add-nylas-build-resources-task.coffee +++ b/build/tasks/add-nylas-build-resources-task.coffee @@ -18,9 +18,10 @@ module.exports = (grunt) -> from = path.join(rootDir, 'packages', plugin) to = path.join(path.resolve('internal_packages'), plugin) - if fs.lstatSync(to) - grunt.log.writeln "Removing old symlink at #{to}" - fs.unlinkSync(to) + try + if fs.lstatSync(to) + grunt.log.writeln "Removing old symlink at #{to}" + fs.unlinkSync(to) grunt.log.writeln "Adding '#{plugin}' to internal_packages" fs.symlinkSync(from, to, 'dir')