Open anztenney opened 5 years ago
I made a couple of changes to leo-cli\lib\build.js
to get this working:
Inside of publish
I added the following:
let args = ['s3', opts.command || 'sync', rootDir, `${remoteDir}`];
if (opts.public) {
args.push("--grants", "read=uri=http://acs.amazonaws.com/groups/global/AllUsers");
}
/*********************code added below**********************************/
if (fs.lstatSync(`${rootDir}`).isDirectory()) {
var files = fs.readdirSync(`${rootDir}`);
for (var i = 0, len = files.length; i < len; i++) {
var match = files[i].match(/.*-index-.*\.js/);
if(match !== null){
fs.unlinkSync(`${rootDir}/${match[0]}`);
console.log(console.log(`Deleted ${match[0]}`));
}
}
}
And in buildLambdaDirectory
I changed
.pipe(gulp.dest(
${opts.dir}/)).on("end", () => {
to
.pipe(gulp.dest(
${opts.dir}/, {"mode": "0655"})).on("end", () => {
Not sure if this is something I should create a PR on, but it got me unblocked for now.
When I run leo-cli publish on a linux machine, it is returning with an error code and message:
When I run the same command from my Windows machine, it runs without issue.
I'm using
leo-cli 2.5.2
and running on Linux: