@@ -63,7 +63,7 @@ class MinimapPluginGeneratorElement {
6363 setPathText ( placeholderName , rangeToSelect ) {
6464 if ( ! rangeToSelect ) { rangeToSelect = [ 0 , placeholderName . length ] }
6565
66- const packagesDirectory = this . getPackagesDirectory ( )
66+ const packagesDirectory = getPackagesDirectory ( )
6767
6868 this . editor . setText ( path . join ( packagesDirectory , placeholderName ) )
6969
@@ -112,12 +112,6 @@ class MinimapPluginGeneratorElement {
112112 return path . join ( path . dirname ( packagePath ) , packageName )
113113 }
114114
115- getPackagesDirectory ( ) {
116- return atom . config . get ( 'core.projectHome' ) ||
117- process . env . ATOM_REPOS_HOME ||
118- path . join ( getHomeDirectory ( ) , 'github' )
119- }
120-
121115 validPackagePath ( ) {
122116 if ( existsSync ( this . getPackagePath ( ) ) ) {
123117 this . error . textContent = `Path already exists at '${ this . getPackagePath ( ) } '`
@@ -167,6 +161,12 @@ class MinimapPluginGeneratorElement {
167161const minimapPluginGeneratorElement = MinimapPluginGeneratorElement . initClass ( )
168162export default minimapPluginGeneratorElement
169163
164+ function getPackagesDirectory ( ) {
165+ return atom . config . get ( 'core.projectHome' ) ||
166+ process . env . ATOM_REPOS_HOME ||
167+ path . join ( getHomeDirectory ( ) , 'github' )
168+ }
169+
170170function isStoredInDotAtom ( packagePath ) {
171171 const packagesPath = path . join ( atom . getConfigDirPath ( ) , 'packages' , path . sep )
172172 if ( packagePath . indexOf ( packagesPath ) === 0 ) { return true }
0 commit comments