Skip to content

Commit d5aa51f

Browse files
committed
pollyfill for copy file sync and docker tag version
1 parent 879a2d4 commit d5aa51f

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// https://serverless.com/blog/writing-serverless-plugins/
44

55
const { spawnSync } = require('child_process');
6-
const fs = require('fs-extra');
6+
const { removeSync } = require('fs-extra');
7+
const copyFileSync = require('fs-copy-file-sync')
78
const path = require('path');
89

910
const NO_OUTPUT_CAPTURE = { stdio: ['ignore', process.stdout, process.stderr] };
@@ -21,7 +22,7 @@ class ServerlessPlugin {
2122
this.custom = Object.assign(
2223
{
2324
cargoFlags: "",
24-
dockerTag: "0.1.0-rust-1.26.1"
25+
dockerTag: "0.1.0-rust-1.26.2"
2526
},
2627
this.serverless.service.custom && this.serverless.service.custom.rust || {}
2728
);
@@ -65,13 +66,13 @@ class ServerlessPlugin {
6566
}
6667
const executablePath = path.resolve('target/lambda/release', crate + '.so');
6768
const targetPath = path.resolve(this.servicePath, crate + '.so');
68-
fs.copyFileSync(executablePath, targetPath);
69+
copyFileSync(executablePath, targetPath);
6970
this.artifacts.push(targetPath);
7071
})
7172
}
7273

7374
clean() {
74-
this.artifacts.forEach(fs.removeSync);
75+
this.artifacts.forEach(removeSync);
7576
}
7677
}
7778

package-lock.json

Lines changed: 6 additions & 1 deletion
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
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-rust",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Serverless framework plugin for Rustlang applications",
55
"main": "index.js",
66
"scripts": {
@@ -23,6 +23,7 @@
2323
},
2424
"homepage": "https://github.com/softprops/serverless-rust#readme",
2525
"dependencies": {
26+
"fs-copy-file-sync": "^1.0.1",
2627
"fs-extra": "^5.0.0",
2728
"serverless": "^1.27.2"
2829
},

0 commit comments

Comments
 (0)