From 6ad2622fbc4b2a5299702b4822ec3c00f0812b8b Mon Sep 17 00:00:00 2001 From: steelbrain Date: Mon, 8 Feb 2016 18:39:18 +0500 Subject: [PATCH 1/5] :new: Add atom-package-path as a dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c87a34..1b94503 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,6 @@ "event-kit": "^1.3.0" }, "dependencies": { - "sb-callsite": "^1.0.0" + "atom-package-path": "^1.0.0" } } From 8aa6afcb79410da43f06cfdbde0cc19e16b97278 Mon Sep 17 00:00:00 2001 From: steelbrain Date: Mon, 8 Feb 2016 18:39:40 +0500 Subject: [PATCH 2/5] :art: Use atom-package-path to determine caller package name --- lib/helpers.js | 6 ------ lib/main.js | 11 +++++------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index 7c6cb4e..444af81 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -2,12 +2,6 @@ import {BufferedProcess} from 'atom' const extractionRegex = /Installing (.*?) to .* (.*)/ -const nameRegex = /(\\|\/)packages(\\|\/)(.*?)(\\|\/)/ - -export function guessName(filePath) { - const matches = nameRegex.exec(filePath) - return matches ? matches[3] : null -} export function installPackages(dependencies, progressCallback) { return new Promise(function(resolve, reject) { diff --git a/lib/main.js b/lib/main.js index 1a9683f..d50956e 100644 --- a/lib/main.js +++ b/lib/main.js @@ -11,12 +11,11 @@ if (typeof window.__steelbrain_package_deps === 'undefined') { export function install(name = null, enablePackages = false) { if (!name) { - const filePath = require('sb-callsite').capture()[1].file - name = guessName(filePath) - if (!name) { - console.log(`Unable to get package name for file: ${filePath}`) - return Promise.resolve() - } + name = require('atom-package-path').guess() + } + if (!name) { + console.log(`Unable to get package name for file: ${filePath}`) + return Promise.resolve() } const {toInstall, toEnable} = packagesToInstall(name) let promise = Promise.resolve() From 2d19e98e4f413663ae5a7a5156a7a1c1d64796b8 Mon Sep 17 00:00:00 2001 From: steelbrain Date: Mon, 8 Feb 2016 18:40:09 +0500 Subject: [PATCH 3/5] :memo: Document change in changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdcb644..45fad2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 3.0.6 + +* Use `atom-package-path` to determine caller package name + ### 3.0.5 * Replace Linux-specific dependency `callsite` with cross-platform `sb-callsite` @@ -38,7 +42,7 @@ ### 2.1.0 -* Introduced second parameter to install method +* Introduced second parameter to install method ### 2.0.x From 0b12c6947ef62e6c9321b9b8ecc6ba5f6e705da6 Mon Sep 17 00:00:00 2001 From: steelbrain Date: Mon, 8 Feb 2016 19:04:54 +0500 Subject: [PATCH 4/5] :arrow_up: Bump dependency version to 1.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb02bd6..9c4305a 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,6 @@ }, "homepage": "https://github.com/AtomLinter/package-deps#readme", "dependencies": { - "atom-package-path": "^1.0.0" + "atom-package-path": "^1.0.1" } } From a238f51e74b52e953e8bf33e1cfb8372ad13fcab Mon Sep 17 00:00:00 2001 From: steelbrain Date: Mon, 8 Feb 2016 19:06:39 +0500 Subject: [PATCH 5/5] :arrow_up: Upgrade travis config --- .travis.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e54e090..5eb4922 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -language: objective-c - notifications: email: on_success: never @@ -12,6 +10,26 @@ git: sudo: false +os: + - linux + - osx + +env: + global: + - APM_TEST_PACKAGES="" + + matrix: + - ATOM_CHANNEL=stable + - ATOM_CHANNEL=beta + +addons: + apt: + packages: + - build-essential + - git + - libgnome-keyring-dev + - fakeroot + branches: only: - master