simple tree differ
This commit is contained in:
1
bin/tree-diff
Symbolic link
1
bin/tree-diff
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../files/tree-diff
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import sys,os
|
import sys,os
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import Image, ImageTk, math, ImageDraw
|
from PIL import Image,ImageTk, ImageDraw
|
||||||
|
import math
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
|
|||||||
32
files/tree-diff
Executable file
32
files/tree-diff
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
VERSION="20190214"
|
||||||
|
|
||||||
|
function helpexit() {
|
||||||
|
BS=$( basename "$0" )
|
||||||
|
echo "Diff the filenames and sizes in two folders"
|
||||||
|
echo "Usage: $BS [-v] folder1 folder2"
|
||||||
|
echo " -v view in vimdiff"
|
||||||
|
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
function _tree() {
|
||||||
|
tree -s -v "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
VIMDIFF=0
|
||||||
|
FOLDERS=( )
|
||||||
|
for ((i=1; i<=${#@}; i++)) {
|
||||||
|
[[ "${!i}" = "-h" ]] && helpexit
|
||||||
|
[[ "${!i}" = "--help" ]] && helpexit
|
||||||
|
[[ "${!i}" = "-v" ]] && { VIMDIFF=1; continue; }
|
||||||
|
FOLDERS+=( "${!i}" )
|
||||||
|
}
|
||||||
|
[[ ${#FOLDERS[@]} -eq 2 ]] || helpexit
|
||||||
|
|
||||||
|
[[ "$VIMDIFF" -eq 1 ]] && {
|
||||||
|
vimdiff <( _tree "${FOLDERS[0]}" ) <( _tree "${FOLDERS[1]}" )
|
||||||
|
} || {
|
||||||
|
diff -y <( _tree "${FOLDERS[0]}" ) <( _tree "${FOLDERS[1]}" ) | \
|
||||||
|
HB_RULES='"|.*" "$c" ".*<" "$r" ">.*" "$g"' highbeam
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user