Skip to content

Instantly share code, notes, and snippets.

@dahu
Created August 6, 2017 08:16
Show Gist options
  • Save dahu/a5fce430f8045d1f87da9fc74ab46f70 to your computer and use it in GitHub Desktop.
Save dahu/a5fce430f8045d1f87da9fc74ab46f70 to your computer and use it in GitHub Desktop.
Script to set a fossil repository's project-name and description fields
#!/bin/sh
# Attribution: unknown. Probably taken from the fossil-users mailing list.
usage() { echo usage: $0 'archive.fossil "project name" "project description"' ; exit 1 ; }
dbname="$1"
pname="$2"
pdesc="$3"
test -z "$4" || usage
test -f "${dbname}" || usage
test -n "${pname}" || usage
test -n "${pdesc}" || usage
fossil sqlite -R "${dbname}" "insert or replace into config values (\"project-name\", \"${pname}\", now());"
fossil sqlite -R "${dbname}" "insert or replace into config values (\"project-description\", \"${pdesc}\", now());"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment