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.

Revisions

  1. dahu created this gist Aug 6, 2017.
    17 changes: 17 additions & 0 deletions fossil_name.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/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());"