Skip to content

Commit c28b2d4

Browse files
authored
Merge pull request #23 from navarasu/fix_17_use_rimraf
#17 Replaced remove dir directly with rimraf library
2 parents 8d673b5 + 382ac73 commit c28b2d4

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

lib/bundle.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const { spawnSync } = require('child_process');
22
const path = require('path');
33
const fs = require('fs-extra');
4+
const rimraf = require('rimraf');
45
const Promise = require('bluebird');
56
var JSZip = require('jszip');
67
Promise.promisifyAll(fs);
@@ -33,7 +34,7 @@ function cleanBuild(){
3334
this.cli.log("Clearing previous build ruby layer build")
3435
this.ruby_layer = path.join(this.servicePath,'.serverless','ruby_layer')
3536
if (fs.pathExistsSync(this.ruby_layer)){
36-
fs.removeSync(this.ruby_layer)
37+
rimraf.sync(this.ruby_layer)
3738
}
3839
}
3940

@@ -151,7 +152,7 @@ function addFiletoZip(zip, dir_path, file_name){
151152

152153
function zipBundleFolder() {
153154
this.gem_folder= fs.readdirSync(path.join(this.build_path,'ruby'))[0]
154-
fs.removeSync(path.join(this.build_path,'ruby',this.gem_folder,'cache'))
155+
rimraf.sync(path.join(this.build_path,'ruby',this.gem_folder,'cache'))
155156
const platform = process.platform == 'win32' ? 'DOS' : 'UNIX'
156157
zipping_message = "Zipping the gemfiles"
157158
if (this.options.native_libs) {

package-lock.json

Lines changed: 6 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"dependencies": {
3232
"bluebird": "^3.5.5",
3333
"fs-extra": "^8.1.0",
34-
"jszip": "^3.1.0"
34+
"jszip": "^3.1.0",
35+
"rimraf": "^3.0.2"
3536
},
3637
"devDependencies": {
3738
"coveralls": "^3.1.0",

0 commit comments

Comments
 (0)