Skip to content

Commit

Permalink
fixed create deck from images
Browse files Browse the repository at this point in the history
  • Loading branch information
Norc committed May 24, 2021
1 parent 29cb6d3 commit 8166f1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/deck.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,12 @@ export class Decks {
src = "forgevtt";
}
let target = `worlds/${game.world.data.name}/Decks/${deckfolderId}/`;
let result = await FilePicker.browse(src, target);
if (result.target != target) {
//check for directory and create it if not found
try {
let result = await FilePicker.browse(src, target)
}
catch(err) {
console.log("error caught, directory does not exist");
await FilePicker.createDirectory(src, target, {});
}
//Deal with Deck Img
Expand Down

0 comments on commit 8166f1d

Please sign in to comment.