mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-17 12:33:06 +00:00
fixes
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
import { isDev } from "./common";
|
||||
import { isARM, isDev } from "./common";
|
||||
import fs from 'fs/promises';
|
||||
export async function getTemplates() {
|
||||
const templatePath = isDev ? './templates.json' : '/app/templates.json';
|
||||
const open = await fs.open(templatePath, 'r');
|
||||
let data;
|
||||
try {
|
||||
data = await open.readFile({ encoding: 'utf-8' });
|
||||
return JSON.parse(data);
|
||||
let data = await open.readFile({ encoding: 'utf-8' });
|
||||
let jsonData = JSON.parse(data)
|
||||
if (isARM(process.arch)) {
|
||||
jsonData = jsonData.filter(d => d.arch !== 'amd64')
|
||||
}
|
||||
return jsonData;
|
||||
} catch (error) {
|
||||
return []
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user