diff --git a/web-interface/public/app-new.js b/web-interface/public/app-new.js index 5041e09..5d1654d 100644 --- a/web-interface/public/app-new.js +++ b/web-interface/public/app-new.js @@ -223,7 +223,14 @@ async function handleCloneSubmit(e) { const includeCSS = includeCSSEl.checked; const includeJS = includeJSEl.checked; const convertLinks = convertLinksEl.checked; - const folderName = customFolderEl ? customFolderEl.value.trim() : ''; + let folderName = customFolderEl ? customFolderEl.value.trim() : ''; + if (folderName.includes('/root/Desktop/CLONE_SITE/')) { + folderName = folderName.replace('/root/Desktop/CLONE_SITE/', '').trim(); + } else if (folderName.includes('/root/Desktop/CLONE_SITE')) { + folderName = folderName.replace('/root/Desktop/CLONE_SITE', '').trim(); + } + // Caso tenha digitado caminhos absolutos, extrair apenas o final + folderName = folderName.replace(/[\/\\]/g, '').trim(); const cloneMethod = 'wget'; if (!url) { @@ -597,7 +604,7 @@ function loadSettings() { // Populate settings form (if needed) const outDirInput = document.getElementById('settingsOutputDir'); - if (outDirInput) outDirInput.value = settings.outputDir || '/root/Desktop/Clonados'; + if (outDirInput) outDirInput.value = settings.outputDir || '/root/Desktop/CLONE_SITE'; } function saveSettings() {