From 0258029003bb0b591341b9c97b2b037c95f4475a Mon Sep 17 00:00:00 2001 From: Adriano Trezub Dea Date: Fri, 2 Oct 2020 02:14:19 -0300 Subject: [PATCH] Repo path windows fix --- src/ScreenHelper.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ScreenHelper.js b/src/ScreenHelper.js index 641c20f..b11a39a 100644 --- a/src/ScreenHelper.js +++ b/src/ScreenHelper.js @@ -1,3 +1,4 @@ +const { dirname } = require('path'); class ScreenHelper { static async alertError(context, message) { return await context.app.alert('Erro!', message); @@ -10,14 +11,8 @@ class ScreenHelper { ); const path = await context.app.showSaveDialog({defaultPath: options.workspaceName}); - return normalizePath(path); + return dirname(path); } } -const normalizePath = (path) => { - if (path == null || path == 'undefined') return null; - - return path.substr(0, path.lastIndexOf('/')); -}; - module.exports = ScreenHelper;