File: prependlicense.sh

package info (click to toggle)
golang-github-digitalocean-go-qemu 0.0~git20250212.ee9b066-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 860 kB
  • sloc: sh: 34; makefile: 3
file content (14 lines) | stat: -rwxr-xr-x 332 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

# License block to be prepended to file
BASEDIR=$(dirname "$0")
LICENSE=$(cat $BASEDIR/license.txt)

if [ -z "$1" ]; then
	echo "missing filename argument"
	echo "usage: prependlicense.sh [filename]"
	exit 1
fi

# Prepend license block to file
echo -e "$LICENSE\n" | cat - $1 > .prependlicense && mv .prependlicense $1