#!/usr/bin/env bash # Format: NeXT 3.5in DSED 2.88MB # gw diskdef: ibm.2880 # External tools: ditool # https://github.com/itomato/Previous # Only ditool is needed (make ditool) # Get project name name="$1" # Include parent script if [[ -f "./gw-raw" ]] then parent="./gw-raw" else parent="$(which gw-raw)" fi source "$parent" "$name" "source" # Output file names img="$name.img" # Overloaded function from gw-raw # Converts Kryoflux raw files to IMG using gw built in format function decode # 1-Nothing { echo "Decoding for NeXT 2.88MB" gw convert --format ibm.2880 "$raw" "$img" 2>&1 | tee -a $log_decode } # Overloaded function from gw-raw # Extracts files from FAT12 filesystem using mtools function extract { # Get list of files ditool -im "$img" -ls 2>&1 | tee -a $log_extract # Create destination mkdir -p "$name-files" # Extract recursively ditool -im "$img" -out "$name-files" 2>&1 | tee -a $log_extract } # Create dir based on name and rip within it mkdir -p "$name" cd "$name" rip A cd ..