Modify launch script to directly write to avatars folder in production mode

This commit is contained in:
Marco van Dijk 2022-10-07 13:21:14 +02:00
parent 4867c455b9
commit 502aa93f23

View File

@ -78,9 +78,15 @@ async function generateRocketeer(id) {
});
// Generate, compile and upload image
const { NODE_ENV: mode } = process.env;
let path;
if (mode == "production"){
path = '/var/www/avatars/' + id
}else{
path = './output/' + id
}
rocketeer.image = await svgFromAttributes(
rocketeer.attributes,
`./output/${id}`
rocketeer.attributes, path
);
// Namify the attributes