dot

packages and services management
Log | Files | Refs | README

commit 3123a89880582844bbd580d8b61cd2ccd66e50f6
parent 53d820b5c5ea28f684ea47d0c581229910651a30
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon,  6 Aug 2018 23:17:41 +0200

bin/tmp: add a file to ~/tmp/<type>/<name>

Diffstat:
Abin/tmp | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/bin/tmp b/bin/tmp @@ -0,0 +1,24 @@ +#!/bin/sh -e + +case "$1" in +(*.mp3|*.mp4|*.ogg|*.flac|*.opus) + type=music + ;; +(*.png|*.jpg|*.jpeg|*.gif|*.tiff) + type=image + ;; +(*.pdf|*.ps|*.djvu) + type=doc + ;; +(*.iso|*.fs) + type=iso + ;; +(*.txt|*.md) + type=text + ;; +esac + +test "$type" || exit 1 + +mkdir -p "$HOME/tmp/$type" +mv "$1" "$HOME/tmp/$type"