diff --git a/src/commands/add.ts b/src/commands/add.ts index 8917947..85ada10 100644 --- a/src/commands/add.ts +++ b/src/commands/add.ts @@ -1,8 +1,10 @@ import * as vscode from "vscode" import { tf } from "../tfs/tfExe" +import * as os from "os" export async function add(uri: vscode.Uri): Promise { - const task = tf(["add", uri.fsPath, "/recursive"]) + const prefix = os.platform() === "linux" ? "-" : "/" // ’darwin’, ‘freebsd’, ‘linux’, ‘sunos’ , ‘win32’ + const task = tf(["add", uri.fsPath, `${prefix}recursive`]) vscode.window.setStatusBarMessage("TFS: Adding...", task) await task diff --git a/src/commands/checkin.ts b/src/commands/checkin.ts index 04d0400..6686b70 100644 --- a/src/commands/checkin.ts +++ b/src/commands/checkin.ts @@ -1,8 +1,10 @@ import * as vscode from "vscode" import { tf } from "../tfs/tfExe" +import * as os from "os" export async function checkin(uri: vscode.Uri): Promise { - const task = tf(["checkin", uri.fsPath, "/recursive"]) + const prefix = os.platform() === "linux" ? "-" : "/" + const task = tf(["checkin", uri.fsPath, `${prefix}recursive`]) vscode.window.setStatusBarMessage("TFS: Checking In...", task) const { stdout } = await task diff --git a/src/commands/checkout.ts b/src/commands/checkout.ts index 7592595..1f8a2d4 100644 --- a/src/commands/checkout.ts +++ b/src/commands/checkout.ts @@ -1,8 +1,10 @@ import * as vscode from "vscode" import { tf } from "../tfs/tfExe" +import * as os from "os" export async function checkout(uri: vscode.Uri): Promise { - const task = tf(["checkout", uri.fsPath, "/recursive"]) + const prefix = os.platform() === "linux" ? "-" : "/" // ’darwin’, ‘freebsd’, ‘linux’, ‘sunos’ , ‘win32’ + const task = tf(["checkout", uri.fsPath, `${prefix}recursive`]) vscode.window.setStatusBarMessage("TFS: Checking...", task) await task diff --git a/src/commands/delete.ts b/src/commands/delete.ts index 2c17925..dc79b95 100644 --- a/src/commands/delete.ts +++ b/src/commands/delete.ts @@ -1,8 +1,10 @@ import * as vscode from "vscode" import { tf } from "../tfs/tfExe" +import * as os from "os" export async function del(uri: vscode.Uri): Promise { - const task = tf(["delete", uri.fsPath, "/recursive"]) + const prefix = os.platform() === "linux" ? "-" : "/" // ’darwin’, ‘freebsd’, ‘linux’, ‘sunos’ , ‘win32’ + const task = tf(["delete", uri.fsPath, `${prefix}recursive`]) vscode.window.setStatusBarMessage("TFS: Deleting...", task) await task diff --git a/src/commands/get.ts b/src/commands/get.ts index 1bc8625..c552a31 100644 --- a/src/commands/get.ts +++ b/src/commands/get.ts @@ -1,8 +1,10 @@ import * as vscode from "vscode" import { tf } from "../tfs/tfExe" +import * as os from "os" export async function get(uri: vscode.Uri): Promise { - const task = tf(["get", uri.fsPath, "/recursive"]) + const prefix = os.platform() === "linux" ? "-" : "/" // ’darwin’, ‘freebsd’, ‘linux’, ‘sunos’ , ‘win32’ + const task = tf(["get", uri.fsPath, `${prefix}recursive`]) vscode.window.setStatusBarMessage("TFS: Getting latest version...", task) await task diff --git a/src/commands/undo.ts b/src/commands/undo.ts index 1f43e13..84c1b68 100644 --- a/src/commands/undo.ts +++ b/src/commands/undo.ts @@ -1,8 +1,10 @@ import * as vscode from "vscode" import { tf } from "../tfs/tfExe" +import * as os from "os" export async function undo(uri: vscode.Uri): Promise { - const task = tf(["undo", uri.fsPath, "/recursive"]) + const prefix = os.platform() === "linux" ? "-" : "/" // ’darwin’, ‘freebsd’, ‘linux’, ‘sunos’ , ‘win32’ + const task = tf(["undo", uri.fsPath, `${prefix}recursive`]) vscode.window.setStatusBarMessage("TFS: Undoing...", task) await task