From ab3617edc1bf743f5bff5f387c5db469bbc07e9e Mon Sep 17 00:00:00 2001 From: Samuel Fabrizio Date: Tue, 29 May 2018 09:48:12 +0200 Subject: [PATCH] [ADD] fallback to normal diff on windows --- lib/diff.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/diff.sh b/lib/diff.sh index 37966f6..e12e949 100644 --- a/lib/diff.sh +++ b/lib/diff.sh @@ -1,13 +1,23 @@ -#!/bin/sh +#!/usr/bin/sh # I took part of this script from here: # https://github.com/zdharma/zsh-diff-so-fancy/blob/master/bin/git-dsf +os_name="" + +if [[ $(uname -s) == Darw* ]]; then + os_name="osx" +elif [[ "$(expr substr $(uname -s) 1 10)" == MINGW* ]]; then + os_name="windows" + git diff --color "$@" + exit 0; +fi + path="$(dirname $0)/../../node_modules/diff-so-fancy/diff-so-fancy" if [ ! -f $path ]; then path="$(dirname $0)/../node_modules/diff-so-fancy/diff-so-fancy" else - echo "error: diff-so-fancy path not found" + echo "turbo-git-diff error: diff-so-fancy path not found" fi f() { @@ -16,4 +26,4 @@ f() { git diff --color "$@" | $path | less --tabs=4 -iRFX } -f "$@" +f "$@"usr pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy