From 0b86db874823d84a773e6ccd48ec3ba11a7cd557 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Thu, 23 Apr 2015 15:34:25 -0400 Subject: [PATCH] Don't show warning when prepEnv copies gradlew and it's read-only --- bin/templates/cordova/lib/build.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js index d4270572..b4ab4872 100644 --- a/bin/templates/cordova/lib/build.js +++ b/bin/templates/cordova/lib/build.js @@ -305,9 +305,11 @@ var builders = { var sdkDir = process.env['ANDROID_HOME']; var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper'); if (process.platform == 'win32') { - shell.cp('-f', path.join(wrapperDir, 'gradlew.bat'), projectPath); + shell.rm('-f', path.join(wrapperDir, 'gradlew.bat'), projectPath); + shell.cp(path.join(wrapperDir, 'gradlew.bat'), projectPath); } else { - shell.cp('-f', path.join(wrapperDir, 'gradlew'), projectPath); + shell.rm('-f', path.join(wrapperDir, 'gradlew'), projectPath); + shell.cp(path.join(wrapperDir, 'gradlew'), projectPath); } shell.rm('-rf', path.join(projectPath, 'gradle', 'wrapper')); shell.mkdir('-p', path.join(projectPath, 'gradle'));