Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit 65a55b2

Browse files
committed
Fix path splitting for different platforms
1 parent 4786339 commit 65a55b2

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.2]
9+
10+
### Fixed
11+
12+
- Path splitting needs to look at process.platform
13+
14+
Contributors: ddieruf
15+
816
## [0.2.1]
917

1018
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "develop-for-apache-pulsar",
33
"displayName": "Develop for Apache Pulsar",
44
"description": "Develop applications that use Apache Pulsar",
5-
"version": "0.2.1",
5+
"version": "0.2.2",
66
"publisher": "DataStax",
77
"engines": {
88
"vscode": "^1.77.0"

src/providers/topicMessageEditorProvider/topicMessagesDocument.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@ export default class TopicMessagesDocument implements vscode.CustomDocument {
1717
// Opening a new document. Parse the info from the uri and build a new document.
1818
if (uri.scheme === 'untitled') {
1919
console.log("Using untitled scheme");
20-
const uriParts = uri.path.split('\\');
20+
21+
let uriParts = null;
22+
23+
if (process.platform === 'win32') {
24+
uriParts = uri.path.split('\\');
25+
} else if (process.platform === 'linux') {
26+
uriParts = uri.path.split('\\');
27+
} else if (process.platform === 'darwin') {
28+
uriParts = uri.path.split('/');
29+
} else { // default to linux
30+
uriParts = uri.path.split('\\');
31+
}
2132

2233
const providerTypeName = uriParts[0];
2334
const clusterName = uriParts[1];

0 commit comments

Comments
 (0)