2014-01-24 4 views
0

실행중인 확장명에 속한 디렉토리에 액세스 할 수있는 표준 방법을 찾고 있습니다. 지금이 kludge 있습니다. main.js와 같은 디렉토리에있는 .json에 액세스 할 수 있습니다.Adobe Brackets - 현재 확장명의 경로 얻기

var support_dir = brackets.app.getApplicationSupportDirectory(), 
    precursor_path, 
    precursor_file = "package.json"; // where this represents some config file. 

support_dir += "/extensions/user/zeffii.precursor/"; 
precursor_path = support_dir + precursor_file; 

var prototypes; 
$.getJSON(precursor_path, function (data) { 
    prototypes = data; 
}); 

답변

3

이 작동합니다 :

var ExtensionUtils = brackets.getModule("utils/ExtensionUtils"); 

var path = ExtensionUtils.getModulePath(module); 

(module은 확장 모듈의 상단에있는 define(function (require, exports, module) {에서 오는 경우).

+0

예, 감사합니다! 이것은 잘 작동합니다. – zeffii

관련 문제