Skip to content

Commit ae73e8e

Browse files
committed
testing
1 parent cb890b4 commit ae73e8e

File tree

1 file changed

+10
-32
lines changed

1 file changed

+10
-32
lines changed

src/main/main.ts

+10-32
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ async function downloadDatabase(url, savePath) {
9595

9696
async function cloneOrUpdateRepository(repoUrl, destinationPath) {
9797
try {
98-
const directoryExistsAlready = await directoryExists(destinationPath);
99-
10098
const git = simpleGit();
10199

102-
if (!directoryExistsAlready) {
100+
if (!fs.existsSync(destinationPath)) {
103101
// Clona el repositorio si el directorio no existe
104102
await git.clone(repoUrl, destinationPath);
105103
console.log(`Repositorio clonado en: ${destinationPath}`);
@@ -113,28 +111,6 @@ async function cloneOrUpdateRepository(repoUrl, destinationPath) {
113111
}
114112
}
115113

116-
async function directoryExists(path) {
117-
try {
118-
await fs.access(path);
119-
return true;
120-
} catch {
121-
return false;
122-
}
123-
}
124-
125-
async function clone() {
126-
const repoUrl = 'https://github.com/EmuDeck/emudeck-launcher-themes.git'; // Cambia esto por la URL de tu repositorio
127-
const destinationPath = `${homeUser}/emudeck/launcher/themes`; // Cambia esto por tu directorio de destino
128-
129-
try {
130-
await cloneOrUpdateRepository(repoUrl, destinationPath);
131-
console.log('El clonado ha finalizado. Ejecutando el resto del código...');
132-
// Coloca aquí el resto de tu código que depende de la finalización del clonado
133-
} catch (error) {
134-
console.error('No se pudo clonar el repositorio. Error:', error);
135-
}
136-
}
137-
138114
// clone();
139115

140116
// Download it
@@ -143,7 +119,6 @@ const destinationPath = `${homeUser}/emudeck/launcher/themes`; // Cambia esto po
143119

144120
cloneOrUpdateRepository(repoUrl, destinationPath)
145121
.then(() => {
146-
console.log('Themes descargadas y guardadas con éxito.');
147122
createWindow();
148123
})
149124
.catch((error) => console.error('Error al guardar los themes:', error));
@@ -894,9 +869,9 @@ if (process.env.NODE_ENV === 'production') {
894869
const isDebug =
895870
process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === 'true';
896871

897-
if (isDebug) {
898-
require('electron-debug')();
899-
}
872+
// if (isDebug) {
873+
require('electron-debug')();
874+
// }
900875

901876
const installExtensions = async () => {
902877
const installer = require('electron-devtools-installer');
@@ -925,10 +900,10 @@ const createWindow = async () => {
925900
};
926901

927902
mainWindow = new BrowserWindow({
928-
show: false,
903+
show: true,
929904
width: 1280,
930905
height: 800,
931-
autoHideMenuBar: true,
906+
autoHideMenuBar: false,
932907
fullscreen: false,
933908
icon: getAssetPath('icon.png'),
934909
webPreferences: {
@@ -940,7 +915,7 @@ const createWindow = async () => {
940915
});
941916

942917
mainWindow.loadURL(resolveHtmlPath('index.html'));
943-
918+
mainWindow.webContents.openDevTools();
944919
mainWindow.on('ready-to-show', () => {
945920
if (!mainWindow) {
946921
throw new Error('"mainWindow" is not defined');
@@ -965,6 +940,8 @@ const createWindow = async () => {
965940
return { action: 'deny' };
966941
});
967942

943+
mainWindow.webContents.openDevTools();
944+
968945
// Remove this if your app does not use auto updates
969946
// eslint-disable-next-line
970947
new AppUpdater();
@@ -986,6 +963,7 @@ app
986963
.whenReady()
987964
.then(() => {
988965
// createWindow();
966+
989967
app.on('activate', () => {
990968
// On macOS it's common to re-create a window in the app when the
991969
// dock icon is clicked and there are no other windows open.

0 commit comments

Comments
 (0)