Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit c254965

Browse files
author
Konstantin Büschel
committed
Merge branch 'release/1.0.0'
2 parents dae8f6b + d5232ef commit c254965

File tree

12 files changed

+1108
-2
lines changed

12 files changed

+1108
-2
lines changed
36.8 KB
Loading

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Version 1.0.0
2+
3+
* Initial release

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
1-
# alfred-vs-code
2-
Alfred workflow to browse and open Visual Studio Code projects
1+
# Alfred Visual Studio Code Project Manager Workflow
2+
3+
Simple workflow that allows you to browse and open [Visual Studio Code](https://code.visualstudio.com/) projects.
4+
5+
* [Requirements](#requirements)
6+
* [Installation](#installation)
7+
* [Usage](#usage)
8+
9+
## Requirements
10+
11+
* [NodeJS](https://nodejs.org)
12+
* [Visual Studio Code Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager)
13+
* [Visual Studio Code Command Line](https://code.visualstudio.com/docs/setup/mac)
14+
* [Alfred Powerpack](https://www.alfredapp.com/powerpack)
15+
16+
## Installation
17+
18+
Download the latest `VisualStudioCode.alfredworkflow` from [GitHub](https://github.com/konstantinbueschel/alfred-vs-code/releases) and import it in Alfred.
19+
20+
## Usage
21+
22+
Simply type `vsc` followed by space to list all projects. Optionally type a search string to filter results.
23+
24+
![alfred-vs-code](documentation/screenshot.png)
25+
26+
## Thanks!
27+
28+
Big Thanks to [Cloudstek](https://github.com/Cloudstek) for his [Alfred Atom Workflow](https://github.com/Cloudstek/alfred-atom) which I used as a base for this project.
2.19 MB
Binary file not shown.

documentation/screenshot.png

306 KB
Loading

icon.png

36.8 KB
Loading

info.plist

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>bundleid</key>
6+
<string>de.kbueschel.alfred.visualstudiocode</string>
7+
<key>category</key>
8+
<string>Productivity</string>
9+
<key>connections</key>
10+
<dict>
11+
<key>4DD30082-AABC-4CFA-8FC3-0738FA31C350</key>
12+
<array>
13+
<dict>
14+
<key>destinationuid</key>
15+
<string>8A722A20-D801-4DAC-AA32-80052ADC87D4</string>
16+
<key>modifiers</key>
17+
<integer>0</integer>
18+
<key>modifiersubtext</key>
19+
<string></string>
20+
<key>vitoclose</key>
21+
<false/>
22+
</dict>
23+
<dict>
24+
<key>destinationuid</key>
25+
<string>76A26469-7BB5-46C5-ADFE-C95581EB9B95</string>
26+
<key>modifiers</key>
27+
<integer>131072</integer>
28+
<key>modifiersubtext</key>
29+
<string>Open project path(s) in finder</string>
30+
<key>vitoclose</key>
31+
<false/>
32+
</dict>
33+
<dict>
34+
<key>destinationuid</key>
35+
<string>16C325FD-9D57-4988-9A88-CE69B2EF34FA</string>
36+
<key>modifiers</key>
37+
<integer>524288</integer>
38+
<key>modifiersubtext</key>
39+
<string>Open project path(s) in terminal</string>
40+
<key>vitoclose</key>
41+
<false/>
42+
</dict>
43+
</array>
44+
<key>8A722A20-D801-4DAC-AA32-80052ADC87D4</key>
45+
<array/>
46+
</dict>
47+
<key>createdby</key>
48+
<string>Konstantin Büschel</string>
49+
<key>description</key>
50+
<string>Simple workflow that allows you to browse and open Visual Studio Code projects.</string>
51+
<key>disabled</key>
52+
<false/>
53+
<key>name</key>
54+
<string>Visual Studio Code</string>
55+
<key>objects</key>
56+
<array>
57+
<dict>
58+
<key>config</key>
59+
<dict>
60+
<key>concurrently</key>
61+
<true/>
62+
<key>escaping</key>
63+
<integer>98</integer>
64+
<key>script</key>
65+
<string>${vscodePath:-/usr/local/bin/code} {query}</string>
66+
<key>scriptargtype</key>
67+
<integer>0</integer>
68+
<key>scriptfile</key>
69+
<string></string>
70+
<key>type</key>
71+
<integer>0</integer>
72+
</dict>
73+
<key>type</key>
74+
<string>alfred.workflow.action.script</string>
75+
<key>uid</key>
76+
<string>8A722A20-D801-4DAC-AA32-80052ADC87D4</string>
77+
<key>version</key>
78+
<integer>2</integer>
79+
</dict>
80+
<dict>
81+
<key>config</key>
82+
<dict>
83+
<key>concurrently</key>
84+
<true/>
85+
<key>escaping</key>
86+
<integer>98</integer>
87+
<key>script</key>
88+
<string>open -a Finder {query}</string>
89+
<key>scriptargtype</key>
90+
<integer>0</integer>
91+
<key>scriptfile</key>
92+
<string></string>
93+
<key>type</key>
94+
<integer>0</integer>
95+
</dict>
96+
<key>type</key>
97+
<string>alfred.workflow.action.script</string>
98+
<key>uid</key>
99+
<string>76A26469-7BB5-46C5-ADFE-C95581EB9B95</string>
100+
<key>version</key>
101+
<integer>2</integer>
102+
</dict>
103+
<dict>
104+
<key>config</key>
105+
<dict>
106+
<key>alfredfiltersresults</key>
107+
<true/>
108+
<key>argumenttrimmode</key>
109+
<integer>0</integer>
110+
<key>argumenttype</key>
111+
<integer>1</integer>
112+
<key>escaping</key>
113+
<integer>102</integer>
114+
<key>keyword</key>
115+
<string>vsc</string>
116+
<key>queuedelaycustom</key>
117+
<integer>3</integer>
118+
<key>queuedelayimmediatelyinitially</key>
119+
<true/>
120+
<key>queuedelaymode</key>
121+
<integer>0</integer>
122+
<key>queuemode</key>
123+
<integer>1</integer>
124+
<key>runningsubtext</key>
125+
<string>Loading projects...</string>
126+
<key>script</key>
127+
<string>$nodePath vsc.js projects</string>
128+
<key>scriptargtype</key>
129+
<integer>1</integer>
130+
<key>scriptfile</key>
131+
<string></string>
132+
<key>subtext</key>
133+
<string>Load Visual Studio Code project</string>
134+
<key>title</key>
135+
<string>Visual Studio Code</string>
136+
<key>type</key>
137+
<integer>0</integer>
138+
<key>withspace</key>
139+
<true/>
140+
</dict>
141+
<key>type</key>
142+
<string>alfred.workflow.input.scriptfilter</string>
143+
<key>uid</key>
144+
<string>4DD30082-AABC-4CFA-8FC3-0738FA31C350</string>
145+
<key>version</key>
146+
<integer>2</integer>
147+
</dict>
148+
<dict>
149+
<key>config</key>
150+
<dict>
151+
<key>concurrently</key>
152+
<true/>
153+
<key>escaping</key>
154+
<integer>98</integer>
155+
<key>script</key>
156+
<string>open -a ${terminalApp:-Terminal} {query}</string>
157+
<key>scriptargtype</key>
158+
<integer>0</integer>
159+
<key>scriptfile</key>
160+
<string></string>
161+
<key>type</key>
162+
<integer>0</integer>
163+
</dict>
164+
<key>type</key>
165+
<string>alfred.workflow.action.script</string>
166+
<key>uid</key>
167+
<string>16C325FD-9D57-4988-9A88-CE69B2EF34FA</string>
168+
<key>version</key>
169+
<integer>2</integer>
170+
</dict>
171+
</array>
172+
<key>readme</key>
173+
<string>Alfred Visual Studio Code Project Manager Workflow
174+
175+
Simple workflow that allows you to browse and open Visual Studio Code https://code.visualstudio.com projects.
176+
177+
Requirements:
178+
- NodeJS https://nodejs.org
179+
- Visual Studio Code Project Manager https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager
180+
- Visual Studio Code Command Line https://code.visualstudio.com/docs/setup/mac
181+
- Alfred Powerpack https://www.alfredapp.com/powerpack
182+
183+
Installation:
184+
Download the latest VisualStudioCode.alfredworkflow from GitHub https://github.com/konstantinbueschel/alfred-vs-code/releases and import it in Alfred.
185+
186+
Usage:
187+
Simply type vsc followed by space to list all projects. Optionally type a search string to filter results.</string>
188+
<key>uidata</key>
189+
<dict>
190+
<key>16C325FD-9D57-4988-9A88-CE69B2EF34FA</key>
191+
<dict>
192+
<key>xpos</key>
193+
<integer>520</integer>
194+
<key>ypos</key>
195+
<integer>300</integer>
196+
</dict>
197+
<key>4DD30082-AABC-4CFA-8FC3-0738FA31C350</key>
198+
<dict>
199+
<key>xpos</key>
200+
<integer>110</integer>
201+
<key>ypos</key>
202+
<integer>180</integer>
203+
</dict>
204+
<key>76A26469-7BB5-46C5-ADFE-C95581EB9B95</key>
205+
<dict>
206+
<key>xpos</key>
207+
<integer>520</integer>
208+
<key>ypos</key>
209+
<integer>180</integer>
210+
</dict>
211+
<key>8A722A20-D801-4DAC-AA32-80052ADC87D4</key>
212+
<dict>
213+
<key>xpos</key>
214+
<integer>520</integer>
215+
<key>ypos</key>
216+
<integer>60</integer>
217+
</dict>
218+
</dict>
219+
<key>variables</key>
220+
<dict>
221+
<key>nodePath</key>
222+
<string>/usr/local/bin/node</string>
223+
<key>terminalApp</key>
224+
<string></string>
225+
<key>vscodePath</key>
226+
<string></string>
227+
</dict>
228+
<key>variablesdontexport</key>
229+
<array>
230+
<string>terminalApp</string>
231+
<string>vscodePath</string>
232+
</array>
233+
<key>version</key>
234+
<string>1.0.0</string>
235+
<key>webaddress</key>
236+
<string>https://github.com/konstantinbueschel/alfred-vs-code</string>
237+
</dict>
238+
</plist>

lib/pathUtils.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
'use strict';
2+
3+
const os = require('os');
4+
5+
exports.homeDir = os.homedir();
6+
exports.homePathVariable = "$home";
7+
8+
/**
9+
* Indicates if a path is a UNC path
10+
*
11+
* @param path The path to check
12+
*/
13+
exports.pathIsUNC = function _pathIsUNC(path) {
14+
return path.indexOf("\\\\") === 0;
15+
};
16+
17+
/**
18+
* If the project path is in the user's home directory then store the home directory as a
19+
* parameter. This will help in situations when the user works with the same projects on
20+
* different machines, under different user names.
21+
*/
22+
exports.compactHomePath = function _compactHomePath(path) {
23+
24+
if (path.indexOf(exports.homeDir) === 0) {
25+
return path.replace(exports.homeDir, exports.homePathVariable);
26+
}
27+
return path;
28+
};
29+
30+
/**
31+
* Expand $home parameter from path to real os home path
32+
*
33+
* @param path The path to expand
34+
*/
35+
exports.expandHomePath = function _expandHomePath(path) {
36+
37+
if (path.indexOf(exports.homePathVariable) === 0) {
38+
return path.replace(exports.homePathVariable, exports.homeDir);
39+
}
40+
return path;
41+
};
42+
43+
/**
44+
* Expand $home parameter from path to real os home path
45+
*
46+
* @param {Object[]} items The array of items <QuickPickItem> to expand
47+
*/
48+
exports.expandHomePaths = function _expandHomePaths(items) {
49+
return items.map(item => {
50+
item.description = exports.expandHomePath(item.description);
51+
return item;
52+
});
53+
};

0 commit comments

Comments
 (0)