Skip to content

Commit d1061a2

Browse files
committed
fix: make isStoredInDotAtom a free function
1 parent 6ab825c commit d1061a2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lib/minimap-plugin-generator-element.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,10 @@ class MinimapPluginGeneratorElement {
147147
runCommand(atom.packages.getApmPath(), args, callback, { cwd: packagePath })
148148
}
149149

150-
isStoredInDotAtom (packagePath) {
151-
const packagesPath = path.join(atom.getConfigDirPath(), 'packages', path.sep)
152-
if (packagePath.indexOf(packagesPath) === 0) { return true }
153-
154-
const devPackagesPath = path.join(atom.getConfigDirPath(), 'dev', 'packages', path.sep)
155-
156-
return packagePath.indexOf(devPackagesPath) === 0
157-
}
158-
159150
createPackageFiles (callback) {
160151
const packagePath = this.getPackagePath()
161152

162-
if (this.isStoredInDotAtom(packagePath)) {
153+
if (isStoredInDotAtom(packagePath)) {
163154
this.initPackage(packagePath, () => {
164155
this.installPackage(packagePath, callback)
165156
})
@@ -176,6 +167,14 @@ class MinimapPluginGeneratorElement {
176167
const minimapPluginGeneratorElement = MinimapPluginGeneratorElement.initClass()
177168
export default minimapPluginGeneratorElement
178169

170+
function isStoredInDotAtom (packagePath) {
171+
const packagesPath = path.join(atom.getConfigDirPath(), 'packages', path.sep)
172+
if (packagePath.indexOf(packagesPath) === 0) { return true }
173+
174+
const devPackagesPath = path.join(atom.getConfigDirPath(), 'dev', 'packages', path.sep)
175+
176+
return packagePath.indexOf(devPackagesPath) === 0
177+
}
179178

180179
function runCommand (command, args, exit, options = {}) {
181180
return new BufferedProcess({ command, args, exit, options })

0 commit comments

Comments
 (0)