Add FileMaker add-on
This commit is contained in:
parent
c09b063284
commit
7d0b93ee28
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.DS_Store
|
BIN
dist/way_addon.zip
vendored
Normal file
BIN
dist/way_addon.zip
vendored
Normal file
Binary file not shown.
0
way.json → dist/way_connector.json
vendored
0
way.json → dist/way_connector.json
vendored
67
scripts/build_addon
Executable file
67
scripts/build_addon
Executable file
@ -0,0 +1,67 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const fs = require('fs').promises;
|
||||||
|
const os = require('os');
|
||||||
|
const path = require('path');
|
||||||
|
const { exec } = require('child_process');
|
||||||
|
|
||||||
|
const ADDONS_PATH = path.join(os.homedir(), '/Library/Application Support/FileMaker/Extensions/AddonModules');
|
||||||
|
const ADDON_PATH = path.join(ADDONS_PATH, 'Way_FileMaker_add-on');
|
||||||
|
const LANGUAGES = 'zh de en es fr it ja ko nl pt sv'.split(' ');
|
||||||
|
|
||||||
|
const TITLE = 'Way FileMaker add-on';
|
||||||
|
const DESCRIPTION = 'FileMaker add-on for easy communication with Way, your all-in-one platform to document, track, and streamline your business operations.';
|
||||||
|
const CATEGORY = 'Integrations';
|
||||||
|
const GUID = '8709587F-FB80-4337-AC4E-0332249FAAA5';
|
||||||
|
const VERSION = '1.0';
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
|
||||||
|
await fs.mkdir('./dist', { recursive: true });
|
||||||
|
|
||||||
|
try {
|
||||||
|
await fs.rm(path.join(ADDON_PATH, '.DS_Store'), { recursive: true });
|
||||||
|
console.log('Removed .DS_Store');
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
const infoPath = path.join(ADDON_PATH, 'info.json');
|
||||||
|
const info = JSON.stringify({
|
||||||
|
GUID,
|
||||||
|
Attribution: 'Smart Yellow',
|
||||||
|
URL: 'https://www.workourway.com',
|
||||||
|
Icon_Color: '#ffffff',
|
||||||
|
Version: VERSION,
|
||||||
|
Clients: ['Pro'],
|
||||||
|
}, null, 4);
|
||||||
|
|
||||||
|
await fs.writeFile(infoPath, info);
|
||||||
|
console.log(`Wrote info to ${path.basename(infoPath)}`);
|
||||||
|
|
||||||
|
for (const language of LANGUAGES) {
|
||||||
|
const infoPath = path.join(ADDON_PATH, `info_${language}.json`);
|
||||||
|
const info = JSON.stringify({
|
||||||
|
Title: TITLE,
|
||||||
|
Description: DESCRIPTION,
|
||||||
|
Category: CATEGORY,
|
||||||
|
Features: [],
|
||||||
|
Optimized: ['Desktop', 'Tablet', 'Mobile'],
|
||||||
|
}, null, 4);
|
||||||
|
|
||||||
|
await fs.writeFile(infoPath, info);
|
||||||
|
console.log(`Wrote info to ${path.basename(infoPath)}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const zipPath = path.join(process.cwd(), `dist/way_addon.zip`);
|
||||||
|
exec(`zip -r ${zipPath} .`, { cwd: ADDON_PATH }, (error, stdout, stderr) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(`Error creating archive: ${error.message}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (stderr) {
|
||||||
|
console.error(`Error creating archive: ${stderr}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(`Archive created: ${ADDON_PATH}.zip`);
|
||||||
|
});
|
||||||
|
|
||||||
|
})();
|
Loading…
x
Reference in New Issue
Block a user