Skip to content

Commit

Permalink
Fixed issue #65
Browse files Browse the repository at this point in the history
  • Loading branch information
varp committed Jun 3, 2017
1 parent d37eddd commit 6917297
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
10 changes: 6 additions & 4 deletions Nodejs.py
Expand Up @@ -43,10 +43,12 @@ def run(self):
# when sublime loads a plugin it's cd'd into the plugin directory. Thus
# __file__ is useless for my purposes. What I want is "Packages/Git", but
# allowing for the possibility that someone has renamed the file.
PLUGIN_DIRECTORY = os.getcwd().replace(os.path.normpath(os.path.join(os.getcwd(), '..', '..')) + os.path.sep, '')
PLUGIN_PATH = os.getcwd().replace(os.path.join(os.getcwd(), '..', '..') + os.path.sep, '')
UGLIFY_PATH = os.path.join(os.getcwd(), "tools", "uglify_js.js")
BUILDER_PATH = os.path.join(os.getcwd(), "tools", "default_build.js")
#
# The above assumption is incorrect for SublimeText 3
PLUGIN_DIRECTORY = os.path.basename(os.path.dirname(__file__))
PLUGIN_PATH = os.path.join(os.getcwd(), PLUGIN_DIRECTORY)
UGLIFY_PATH = os.path.join(PLUGIN_PATH, "tools", "uglify_js.js")
BUILDER_PATH = os.path.join(PLUGIN_PATH, "tools", "default_build.js")


def open_url(url):
Expand Down
7 changes: 6 additions & 1 deletion Readme.md
Expand Up @@ -55,6 +55,11 @@ You can install this package from [Sublime Text 3 package manager](https://packa

`git clone https://github.com/tanepiper/SublimeText-Nodejs $HOME/.config/sublime-text-3/Packages/Nodejs`

After the package is installed, install Node.js packages needed for working the package built-in tools. You can to install either globaly by: `npm install -g commander@"~2.9.0" uglify-js@"~2.6.0"` or localy by adding previously mentioned Node.js packages to your current project, either: `npm install commander@"~2.9.0" uglify-js@"~2.6.0"` or manully editing your project `package.json` file.

PLEASE NOTE: When your installed Node.js packages (previously mentioned) globaly, you also need to set the package `node_path` setting. For that, go to the `Preferences -> Package Settings -> Nodejs -> Settings User`.


Build Systems
-------------
PLEASE NOTE: The build system will be refactored to provide different nodejs build systems (such as jake)
Expand All @@ -65,7 +70,7 @@ You may need to add a `path` variable to the settings object for this if your no

TODO
----
* ~~uglify_js.js and other ./tools/*.js scripts don't work when the package is installed by SublimeText package manager~~
* ~~uglify_js.js and other ./tools/*.js scripts dosen't work when the package is installed by SublimeText package manager~~
* Use events API to install NodeJs dependicies for tools provided by the package
* Refactor plugin's classes inheritance in Nodejs.py
* Use events API to generate Sublime Text completions during installation phase depending on a version of installed NodeJs
Expand Down
1 change: 1 addition & 0 deletions messages/1.5.6.txt
Expand Up @@ -3,3 +3,4 @@ Version 1.5.6
This is a bugfix release version

* Fix issue-63. Now can run built-in tools, when the package is installed by Package Control [See more at GitHub](https://github.com/tanepiper/SublimeText-Nodejs/issues/63)
* Fix issue-65. Now the package resolves correct path for built-in tools. [See more at GitHub](https://github.com/tanepiper/SublimeText-Nodejs/issues/65)
8 changes: 4 additions & 4 deletions package.json
@@ -1,9 +1,9 @@
{
"name": "sublime-nodejs",
"version": "1.5.3",
"description": "NPM Support file for the Sublime Text 2/3 Nodejs Plugin",
"version": "1.5.6",
"description": "NPM Support file for the Sublime Text 3 Nodejs Plugin",
"dependencies": {
"commander": "~2.9.0",
"uglify-js": "~2.6.0"
"commander": "^2.9.0",
"uglify-js": "^2.6.4"
}
}
2 changes: 0 additions & 2 deletions tools/default_build.js
Expand Up @@ -14,5 +14,3 @@ doc_builder({
}, function() {
console.log('Done!');
});


0 comments on commit 6917297

Please sign in to comment.