Skip to content

Commit 9a4b8b8

Browse files
authored
Merge pull request #1 from gregorhollmig/master
Merge fixes for windows file path
2 parents d38ed19 + 6d48a64 commit 9a4b8b8

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/ScreenHelper.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1+
const { dirname } = require('path');
12
class ScreenHelper {
23
static async alertError(context, message) {
34
return await context.app.alert('Erro!', message);
45
}
56

67
static async askRepoPath(context, options={}) {
78
await context.app.alert(
8-
'Selecione Repositorio',
9-
`Escolha o repositorio para sincronizar workspaces\nWorkspace Atual: ${options.currentPath}`
9+
'Select repository',
10+
`Chose the repository to synchronize your workspace\nCurrent path: ${options.currentPath}`
1011
);
1112
const path = await context.app.showSaveDialog({defaultPath: options.workspaceName});
1213

13-
return normalizePath(path);
14+
return dirname(path);
1415
}
1516
}
1617

17-
const normalizePath = (path) => {
18-
if (path == null || path == 'undefined') return null;
19-
20-
return path.substr(0, path.lastIndexOf('/'));
21-
};
22-
2318
module.exports = ScreenHelper;

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const ScreenHelper = require('./ScreenHelper.js');
55
const verifyRepoConfig = async (repo, context) => {
66
if (await repo.isConfigured(context)) return true;
77

8-
ScreenHelper.alertError(context, 'Workspace não foi setado!');
8+
ScreenHelper.alertError(context, 'Workspace was not set');
99
return false;
1010
};
1111

0 commit comments

Comments
 (0)