Add init-day.sh script with template.rb
This commit is contained in:
parent
5d3108939e
commit
37f6aed050
22
init-day.sh
Executable file
22
init-day.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
BASEDIR=$(dirname "$0")
|
||||
|
||||
if [ ! -z "$1" ]
|
||||
then
|
||||
DAY=$(printf "%02d" "$1")
|
||||
else
|
||||
DAY=$(date +%d)
|
||||
fi
|
||||
|
||||
cd $BASEDIR/
|
||||
|
||||
if [ ! -d $DAY ]
|
||||
then
|
||||
mkdir $DAY
|
||||
fi
|
||||
|
||||
if [ ! -f $DAY/script.rb ]
|
||||
then
|
||||
sed "s/NB/$DAY/" template.rb >$DAY/script.rb
|
||||
fi
|
13
template.rb
Executable file
13
template.rb
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require_relative '../common'
|
||||
|
||||
class DayNB < Day
|
||||
def part1
|
||||
end
|
||||
|
||||
def part2
|
||||
end
|
||||
end
|
||||
|
||||
DayNB.run
|
Loading…
x
Reference in New Issue
Block a user