[vscode] 윈도우 USB에 VSCode 포터블과 Project Manager 사용시 rootPath 형식 변경
프로그래밍 툴/Visual Studio Code 2017. 1. 21. 15:25윈도우에서 USB 에
VSCode 를 포터블로 설치하고 WorkSpace 도 USB에 있을 경우
Project Manager 을 사용할 경우 USB 의 드라이브가 변경시마다 경로를 수정해 줘야 한다.
그래서 임시로 Project Manager 를 수정하여
rootPath 의 C:\WorkSpace\Project 의 경로를 /WorkSpace/Project 로 적용되도록 변경해 준다.
extension.js
function compactHomePath(path) {
if (path.indexOf(homeDir) === 0) {
return path.replace(homeDir, homePathVariable);
}
return path;
}
를 수정
function compactHomePath(path) {
if (path.indexOf(homeDir) === 0) {
return path.replace(homeDir, homePathVariable);
}
return path.replace(/\\/g, '/').substr(2, path.length);
//return path;
}
storage.js
ProjectStorage.prototype.existsWithRootPath = function (rootPath) {
for (var i = 0; i < this.projectList.length; i++) {
var element = this.projectList[i];
if (element.rootPath.toLocaleLowerCase() == rootPath.toLocaleLowerCase()) {
return element;
}
}
};
를 수정
ProjectStorage.prototype.existsWithRootPath = function (rootPath) {
for (var i = 0; i < this.projectList.length; i++) {
var element = this.projectList[i];
if (element.rootPath.toLocaleLowerCase() == rootPath.toLocaleLowerCase()) {
return element;
}
else if (element.rootPath.substr(0, 1) == '/') {
var new_root_path = rootPath.replace(/\\/g, '/').toLocaleLowerCase();
if (element.rootPath.toLocaleLowerCase() == new_root_path.substr(2, new_root_path.length)) {
return element;
}
}
}
};
더불어 USB에서 사용시 User Settings 에서 "projectManager.projectsLocation" 도 별도로 변경해 주는게 좋다.
임시로 수정한 이유는 Project Manager의 Issues 에 관련 사항이 있어 추후 수정이 될것 같기 때문
'프로그래밍 툴 > Visual Studio Code' 카테고리의 다른 글
[vscode] 윈도우용 키보드 단축키 (0) | 2017.01.16 |
---|---|
extension for VS Code (0) | 2016.12.16 |