@@ -95,11 +95,9 @@ async function downloadDatabase(url, savePath) {
95
95
96
96
async function cloneOrUpdateRepository ( repoUrl , destinationPath ) {
97
97
try {
98
- const directoryExistsAlready = await directoryExists ( destinationPath ) ;
99
-
100
98
const git = simpleGit ( ) ;
101
99
102
- if ( ! directoryExistsAlready ) {
100
+ if ( ! fs . existsSync ( destinationPath ) ) {
103
101
// Clona el repositorio si el directorio no existe
104
102
await git . clone ( repoUrl , destinationPath ) ;
105
103
console . log ( `Repositorio clonado en: ${ destinationPath } ` ) ;
@@ -113,28 +111,6 @@ async function cloneOrUpdateRepository(repoUrl, destinationPath) {
113
111
}
114
112
}
115
113
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
-
138
114
// clone();
139
115
140
116
// Download it
@@ -143,7 +119,6 @@ const destinationPath = `${homeUser}/emudeck/launcher/themes`; // Cambia esto po
143
119
144
120
cloneOrUpdateRepository ( repoUrl , destinationPath )
145
121
. then ( ( ) => {
146
- console . log ( 'Themes descargadas y guardadas con éxito.' ) ;
147
122
createWindow ( ) ;
148
123
} )
149
124
. catch ( ( error ) => console . error ( 'Error al guardar los themes:' , error ) ) ;
@@ -894,9 +869,9 @@ if (process.env.NODE_ENV === 'production') {
894
869
const isDebug =
895
870
process . env . NODE_ENV === 'development' || process . env . DEBUG_PROD === 'true' ;
896
871
897
- if ( isDebug ) {
898
- require ( 'electron-debug' ) ( ) ;
899
- }
872
+ // if (isDebug) {
873
+ require ( 'electron-debug' ) ( ) ;
874
+ // }
900
875
901
876
const installExtensions = async ( ) => {
902
877
const installer = require ( 'electron-devtools-installer' ) ;
@@ -925,10 +900,10 @@ const createWindow = async () => {
925
900
} ;
926
901
927
902
mainWindow = new BrowserWindow ( {
928
- show : false ,
903
+ show : true ,
929
904
width : 1280 ,
930
905
height : 800 ,
931
- autoHideMenuBar : true ,
906
+ autoHideMenuBar : false ,
932
907
fullscreen : false ,
933
908
icon : getAssetPath ( 'icon.png' ) ,
934
909
webPreferences : {
@@ -940,7 +915,7 @@ const createWindow = async () => {
940
915
} ) ;
941
916
942
917
mainWindow . loadURL ( resolveHtmlPath ( 'index.html' ) ) ;
943
-
918
+ mainWindow . webContents . openDevTools ( ) ;
944
919
mainWindow . on ( 'ready-to-show' , ( ) => {
945
920
if ( ! mainWindow ) {
946
921
throw new Error ( '"mainWindow" is not defined' ) ;
@@ -965,6 +940,8 @@ const createWindow = async () => {
965
940
return { action : 'deny' } ;
966
941
} ) ;
967
942
943
+ mainWindow . webContents . openDevTools ( ) ;
944
+
968
945
// Remove this if your app does not use auto updates
969
946
// eslint-disable-next-line
970
947
new AppUpdater ( ) ;
986
963
. whenReady ( )
987
964
. then ( ( ) => {
988
965
// createWindow();
966
+
989
967
app . on ( 'activate' , ( ) => {
990
968
// On macOS it's common to re-create a window in the app when the
991
969
// dock icon is clicked and there are no other windows open.
0 commit comments