# can guess based on the existence of the file. We can't be sure
# because it could be a file like x.jpg, that we just don't have
# in our local repo.
- elif [[ ! -f $path && -e $path.mdwn ]]; then
+ elif [[ ! -f $path && -e $path.mdwn ]]; then
path=${path}.mdwn
fi
j printf "%s\n" "$path"
fi
}
+# wip
+apache-apply() {
+ for file; do
+ if head -n1 "$file"| grep -E '^#!/bin/bash\b' &>/dev/null; then
+ {
+ head -n1 "$file"
+ cat <<'EOF'
+# I follow the GNU license recommendations,
+# https://www.gnu.org/licenses/license-recommendations.en.html, which
+# recommends that small programs, < 300 lines, such those contained in
+# this file or related to this file, be licensed Apache License 2.0. Any
+# program which grows large enough, I will switch it to GPL.
+
+# Copyright 2024 Ian Kelling
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+EOF
+ tail -n+2 "$file"
+ } | sponge "$file"
+ fi
+ done
+}
+
chrome() {
if type -p chromium &>/dev/null; then
cmd=chromium