3 # Print diffs for each _FILE, ~/.FILE pair
5 # There are two modes, local and standard. In standard mode, we show the
6 # transition ~/.file -> _file, which shows the changes effected by
7 # `make override`. In local mode we show the transition _file -> ~/.file,
8 # which shows the changes we need to apply to the .dotfiles to create
9 # your current local installation. The --local option selects local mode.
11 LOCAL="no" # Select diff ordering
23 # Show the changes we'd apply on installation
25 # handleFile( $file, $dotfile )
28 # file - The file we're processing '_foo'
29 # dotfile - The file it should be linked to in ~/, e.g. '.foo'
30 function handleFile( )
32 if [ $LOCAL == "yes" ]; then
39 # See if we can find any _files.
43 found=`expr $found + 1`
47 # If we found none then exit
48 if [ "$found" -lt 1 ]; then
49 echo "WARNING: No files matching _* were found"
53 # For each file in this directory.
55 # Create .dotfile version.
58 if [ ! -e ~/$dotfile ]; then
59 echo "~/$dotfile doesn't exist"
62 handleFile $i ~/$dotfile