@@ -30,12 +30,14 @@ class List extends Command
30
30
apm list --themes
31
31
apm list --packages
32
32
apm list --installed
33
+ apm list --installed --enabled
33
34
apm list --installed --bare > my-packages.txt
34
35
apm list --json
35
36
36
37
List all the installed packages and also the packages bundled with Atom.
37
38
"""
38
39
options .alias (' b' , ' bare' ).boolean (' bare' ).describe (' bare' , ' Print packages one per line with no formatting' )
40
+ options .alias (' e' , ' enabled' ).boolean (' enabled' ).describe (' enabled' , ' Print only enabled packages' )
39
41
options .alias (' d' , ' dev' ).boolean (' dev' ).default (' dev' , true ).describe (' dev' , ' Include dev packages' )
40
42
options .alias (' h' , ' help' ).describe (' help' , ' Print this usage message' )
41
43
options .alias (' i' , ' installed' ).boolean (' installed' ).describe (' installed' , ' Only list installed packages/themes' )
@@ -81,11 +83,14 @@ class List extends Command
81
83
manifest ?= {}
82
84
manifest .name = child
83
85
if options .argv .themes
84
- packages .push (manifest) if manifest .theme
86
+ if manifest .theme and not (options .argv .enabled and @ isPackageDisabled (manifest .name ))
87
+ packages .push (manifest)
85
88
else if options .argv .packages
86
- packages .push (manifest) unless manifest .theme
89
+ unless manifest .theme or (options .argv .enabled and @ isPackageDisabled (manifest .name ))
90
+ packages .push (manifest)
87
91
else
88
- packages .push (manifest)
92
+ unless options .argv .enabled and @ isPackageDisabled (manifest .name )
93
+ packages .push (manifest)
89
94
90
95
packages
91
96
@@ -114,18 +119,20 @@ class List extends Command
114
119
callback? (null , gitPackages)
115
120
116
121
listBundledPackages : (options , callback ) ->
117
- config .getResourcePath (resourcePath) - >
122
+ config .getResourcePath (resourcePath) = >
118
123
try
119
124
metadataPath = path .join (resourcePath, ' package.json' )
120
125
{_atomPackages } = JSON .parse (fs .readFileSync (metadataPath))
121
126
_atomPackages ?= {}
122
127
packages = (metadata for packageName, {metadata} of _atomPackages)
123
128
124
- packages = packages .filter (metadata) - >
129
+ packages = packages .filter (metadata) = >
125
130
if options .argv .themes
126
131
metadata .theme
127
132
else if options .argv .packages
128
133
not metadata .theme
134
+ else if options .argv .enabled
135
+ not @ isPackageDisabled (metadata .name )
129
136
else
130
137
true
131
138
0 commit comments