Skip to content

Commit

Permalink
vsce publish v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lfurzewaddock committed Jul 17, 2018
1 parent 740827a commit 7ce701d
Show file tree
Hide file tree
Showing 22 changed files with 9,608 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
["env", {
"targets": {
"node": "current"
}
}]
],
"plugins": [
"add-module-exports"
]
}
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Babel output directory
lib/*

# Node Modules
node_modules/*
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "airbnb",
"env": {
"node": true
},
"rules": {
"no-var": "off",
"quotes": ["error", "double"],
"prefer-arrow-callback": [ "error", { "allowNamedFunctions": true } ],
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["./bin/**/*", "./test/**/*.js", "./webpack/**/*.js"]}],
"no-param-reassign": ["error", { "props": false }],
"no-use-before-define":"off",
"strict":"off"
}
}
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Set default behavior to automatically normalize line endings.
* text=auto

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.nyc_output
coverage
lib
node_modules
*.vsix

5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Babel output directory
lib/*

# Node Modules
node_modules/*
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
50 changes: 50 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "localhost",
"port": 5858,
"sourceMaps": false,
"localRoot": "${workspaceFolder}",
"remoteRoot": "${command:extension.vscode-wsl-workspaceFolder}"
},
{
"name": "Test Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"preLaunchTask": "npm: babel",
"sourceMaps": true,
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
},
{
"type": "node",
"request": "launch",
"name": "Launch npm Debug",
"useWSL": true,
"stopOnEntry": true,
"sourceMaps": false,
"args": [],
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"debug"
],
"env": {
"NODE_ENV": "development"
},
"port": 5858,
"console": "internalConsole"
}
]
}
9 changes: 9 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*
*/**
**/.DS_Store
!lib/*.js
!node_modules/**
!public/**
!README.md
!CHANGELOG.md
!LICENSE
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Change Log
All notable changes to the "vscode-wsl-workspacefolder" extension will be documented in this file.

## [1.0.0]
- Initial release

## [1.0.1]
- Minor corrections/changes to docs

## [1.0.2]
- Minor corrections/changes to docs
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# VS Code extension: WSL workspaceFolder

Gets workspaceFolder path in WSL path format, using WSL `wslpath` tool.

Use command as a placeholder where WSL path for the workspaceFolder is required, e.g. the 'remoteRoot' attribute in launch config for debug, etc.

## Features

This extension returns the workspaceFolder path, converted from Windows path format to WSL path format. For example, a workspaceFolder with a windows path of `c:\\Users\\Me\\Projects\\project` would return a WSL path of `/mnt/c/Users/Me/Projects/project`.

## Requirements

- MS Windows 10 using WSL (Windows Subsystem for Linux)
- MS Windows 10 => version 17046 for [wslpath tool](https://github.com/MicrosoftDocs/WSL/blob/master/WSL/release-notes.md#build-17046)
- Extension code contributors should either install current release of WSL workspaceFolder or replace command reference in .vscode/launch.json

## Extension Settings

This extension contributes the following command:

* `extension.vscode-wsl-workspaceFolder`: returns WSL format path string to workspaceFolder

## Usage

e.g. `.vscode/launch.json`

```
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "localhost",
"port": 5858,
"sourceMaps": false,
"localRoot": "${workspaceFolder}",
"remoteRoot": "${command:extension.vscode-wsl-workspaceFolder}"
}
]
}
```

## Known Issues

- When invoked by VS Code in MS Windows 10 environment, which does not use WSL, this extension will still attempt to return a WSL path format, even when this is not possible/required.

## Release Notes

### 1.0.0

Initial release of VS Code extension `vscode-wsl-workspacefolder`

### 1.0.1

Minor corrections/changes to docs

### 1.0.2

Minor corrections/changes to docs

### Extension Icon

Folder icon (no text) sourced from [theSquid.ink 40](https://www.iconfinder.com/icons/416376/envelope_files_folder_interface_office_icon), under [Creative Commons (Attribution 3.0 Unported)](https://creativecommons.org/licenses/by/3.0/) licence.
69 changes: 69 additions & 0 deletions bin/opn-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env node

"use strict";

const open = require("opn");
const parseArgs = require("minimist");

const args = parseArgs(process.argv.slice(2), {
boolean: ["help", "h", "wait"],
"--": true,
});

if (args.h || args.help) {
error(null, true);
} else if (targetFileOrUrl(args._[0])) {
openTarget(targetFileOrUrl(args._[0]), args.wait, args["--"]);
} else if (process.argv.length <= 2) {
error("Target to open not provided!", true);
} else {
error("Usage incorrect!", true);
}

function targetFileOrUrl(targetArgs) {
if (typeof targetArgs === "string" && targetArgs.length > 0) {
const [fileOrUrl] = args._;
return fileOrUrl;
}
return null;
}

function openTarget(target, wait, options) {
var appOptions = {
wait,
};
if (options.length > 0) {
appOptions.app = options;
}
open(target, appOptions);
}

function printHelp() {
/* eslint-disable no-console */
console.log(`
opn-cli usage: <file|url> [--wait] [-- <app> [args]
-h, --help output usage information
<file|url> open target file/url in OS default app for file type
--wait wait for app opened to exit before fulfilling promise
-- <app> [args] specify which app to open instead of OS default app including optional arguments
`);
/* eslint-enable no-console */
}

function error(err, showHelp = false) {
if (err) {
/* eslint-disable no-console */
console.log(`
${err.toString()}
`);
/* eslint-enable no-console */
}
if (showHelp) {
printHelp();
}
}
Loading

0 comments on commit 7ce701d

Please sign in to comment.