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

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Büschel committed Aug 28, 2017
2 parents dae8f6b + d5232ef commit c254965
Show file tree
Hide file tree
Showing 12 changed files with 1,108 additions and 2 deletions.
Binary file added 4DD30082-AABC-4CFA-8FC3-0738FA31C350.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Version 1.0.0

* Initial release
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# alfred-vs-code
Alfred workflow to browse and open Visual Studio Code projects
# Alfred Visual Studio Code Project Manager Workflow

Simple workflow that allows you to browse and open [Visual Studio Code](https://code.visualstudio.com/) projects.

* [Requirements](#requirements)
* [Installation](#installation)
* [Usage](#usage)

## Requirements

* [NodeJS](https://nodejs.org)
* [Visual Studio Code Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager)
* [Visual Studio Code Command Line](https://code.visualstudio.com/docs/setup/mac)
* [Alfred Powerpack](https://www.alfredapp.com/powerpack)

## Installation

Download the latest `VisualStudioCode.alfredworkflow` from [GitHub](https://github.com/konstantinbueschel/alfred-vs-code/releases) and import it in Alfred.

## Usage

Simply type `vsc` followed by space to list all projects. Optionally type a search string to filter results.

![alfred-vs-code](documentation/screenshot.png)

## Thanks!

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.
Binary file added dist/VisualStudioCode.alfredworkflow
Binary file not shown.
Binary file added documentation/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
238 changes: 238 additions & 0 deletions info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>de.kbueschel.alfred.visualstudiocode</string>
<key>category</key>
<string>Productivity</string>
<key>connections</key>
<dict>
<key>4DD30082-AABC-4CFA-8FC3-0738FA31C350</key>
<array>
<dict>
<key>destinationuid</key>
<string>8A722A20-D801-4DAC-AA32-80052ADC87D4</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>76A26469-7BB5-46C5-ADFE-C95581EB9B95</string>
<key>modifiers</key>
<integer>131072</integer>
<key>modifiersubtext</key>
<string>Open project path(s) in finder</string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>16C325FD-9D57-4988-9A88-CE69B2EF34FA</string>
<key>modifiers</key>
<integer>524288</integer>
<key>modifiersubtext</key>
<string>Open project path(s) in terminal</string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>8A722A20-D801-4DAC-AA32-80052ADC87D4</key>
<array/>
</dict>
<key>createdby</key>
<string>Konstantin Büschel</string>
<key>description</key>
<string>Simple workflow that allows you to browse and open Visual Studio Code projects.</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Visual Studio Code</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<true/>
<key>escaping</key>
<integer>98</integer>
<key>script</key>
<string>${vscodePath:-/usr/local/bin/code} {query}</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>8A722A20-D801-4DAC-AA32-80052ADC87D4</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<true/>
<key>escaping</key>
<integer>98</integer>
<key>script</key>
<string>open -a Finder {query}</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>76A26469-7BB5-46C5-ADFE-C95581EB9B95</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<true/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>1</integer>
<key>escaping</key>
<integer>102</integer>
<key>keyword</key>
<string>vsc</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<key>runningsubtext</key>
<string>Loading projects...</string>
<key>script</key>
<string>$nodePath vsc.js projects</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>subtext</key>
<string>Load Visual Studio Code project</string>
<key>title</key>
<string>Visual Studio Code</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>4DD30082-AABC-4CFA-8FC3-0738FA31C350</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<true/>
<key>escaping</key>
<integer>98</integer>
<key>script</key>
<string>open -a ${terminalApp:-Terminal} {query}</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>16C325FD-9D57-4988-9A88-CE69B2EF34FA</string>
<key>version</key>
<integer>2</integer>
</dict>
</array>
<key>readme</key>
<string>Alfred Visual Studio Code Project Manager Workflow
Simple workflow that allows you to browse and open Visual Studio Code https://code.visualstudio.com projects.
Requirements:
- NodeJS https://nodejs.org
- Visual Studio Code Project Manager https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager
- Visual Studio Code Command Line https://code.visualstudio.com/docs/setup/mac
- Alfred Powerpack https://www.alfredapp.com/powerpack
Installation:
Download the latest VisualStudioCode.alfredworkflow from GitHub https://github.com/konstantinbueschel/alfred-vs-code/releases and import it in Alfred.
Usage:
Simply type vsc followed by space to list all projects. Optionally type a search string to filter results.</string>
<key>uidata</key>
<dict>
<key>16C325FD-9D57-4988-9A88-CE69B2EF34FA</key>
<dict>
<key>xpos</key>
<integer>520</integer>
<key>ypos</key>
<integer>300</integer>
</dict>
<key>4DD30082-AABC-4CFA-8FC3-0738FA31C350</key>
<dict>
<key>xpos</key>
<integer>110</integer>
<key>ypos</key>
<integer>180</integer>
</dict>
<key>76A26469-7BB5-46C5-ADFE-C95581EB9B95</key>
<dict>
<key>xpos</key>
<integer>520</integer>
<key>ypos</key>
<integer>180</integer>
</dict>
<key>8A722A20-D801-4DAC-AA32-80052ADC87D4</key>
<dict>
<key>xpos</key>
<integer>520</integer>
<key>ypos</key>
<integer>60</integer>
</dict>
</dict>
<key>variables</key>
<dict>
<key>nodePath</key>
<string>/usr/local/bin/node</string>
<key>terminalApp</key>
<string></string>
<key>vscodePath</key>
<string></string>
</dict>
<key>variablesdontexport</key>
<array>
<string>terminalApp</string>
<string>vscodePath</string>
</array>
<key>version</key>
<string>1.0.0</string>
<key>webaddress</key>
<string>https://github.com/konstantinbueschel/alfred-vs-code</string>
</dict>
</plist>
53 changes: 53 additions & 0 deletions lib/pathUtils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

const os = require('os');

exports.homeDir = os.homedir();
exports.homePathVariable = "$home";

/**
* Indicates if a path is a UNC path
*
* @param path The path to check
*/
exports.pathIsUNC = function _pathIsUNC(path) {
return path.indexOf("\\\\") === 0;
};

/**
* If the project path is in the user's home directory then store the home directory as a
* parameter. This will help in situations when the user works with the same projects on
* different machines, under different user names.
*/
exports.compactHomePath = function _compactHomePath(path) {

if (path.indexOf(exports.homeDir) === 0) {
return path.replace(exports.homeDir, exports.homePathVariable);
}
return path;
};

/**
* Expand $home parameter from path to real os home path
*
* @param path The path to expand
*/
exports.expandHomePath = function _expandHomePath(path) {

if (path.indexOf(exports.homePathVariable) === 0) {
return path.replace(exports.homePathVariable, exports.homeDir);
}
return path;
};

/**
* Expand $home parameter from path to real os home path
*
* @param {Object[]} items The array of items <QuickPickItem> to expand
*/
exports.expandHomePaths = function _expandHomePaths(items) {
return items.map(item => {
item.description = exports.expandHomePath(item.description);
return item;
});
};
Loading

0 comments on commit c254965

Please sign in to comment.