Skip to content

Commit

Permalink
images folder
Browse files Browse the repository at this point in the history
  • Loading branch information
willemliufdmg committed Dec 16, 2021
1 parent 6822e8d commit 047aff6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ console.log(`Cache-control: ${CacheControl}`);
console.log(`Dry-run: ${argv.dryRun}`);
const environment = argv.environment || process.env.ENVIRONMENT;
console.log(`Environment: ${environment}`);
const imagesFolder =
let imagesFolder =
argv.imagesFolder || process.env.IMGIX_UPLOAD_RELATIVE_IMAGE_FOLDER_LOCATION;
imagesFolder =
imagesFolder.indexOf(".") === 0
? `${path.join(process.cwd(), imagesFolder)}`
: imagesFolder;
console.log(`Images folder: ${imagesFolder}`);
const imageMapLocation =
argv.outputImageMapLocation ||
Expand Down Expand Up @@ -173,11 +177,7 @@ async function uploadToS3(absolutePath: string, hashedFileName: string) {
*/
async function init(props: { imageMapLocation: string; imagesFolder: string }) {
let ticks = 0;
const files = await getFiles(
props.imagesFolder.indexOf(".") === 0
? `${path.join(process.cwd(), props.imagesFolder)}`
: props.imagesFolder
);
const files = await getFiles(props.imagesFolder);
if (debug) {
console.log(files);
}
Expand Down

0 comments on commit 047aff6

Please sign in to comment.