Skip to content

Commit

Permalink
packaging icons folder workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
bensteUEM committed Jun 20, 2024
1 parent 4f44fb9 commit bbb4123
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = require('@companion-module/tools/eslint/index.cjs')({
// Enable support for jest globals in test files
enableJest: false,
// Enable support for typescript
enableTypescript: false,
// Enable support for jest globals in test files
enableJest: false,
// Enable support for typescript
enableTypescript: false,
})
7 changes: 6 additions & 1 deletion src/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export function get_images() {

image_names.forEach(function (filename) {
// Read the contents of the image file and convert the data to a base64-encoded string
data = fs.readFileSync(`./icons/${filename}.png`)
const folder_path = './icons/'
if (fs.existsSync(folder_path)) {
data = fs.readFileSync(`./icons/${filename}.png`)
} else {
data = fs.readFileSync(`${filename}.png`)
}
base64String = Buffer.from(data).toString('base64')
images[filename] = base64String
})
Expand Down

0 comments on commit bbb4123

Please sign in to comment.