From 7968d3b30a4da523ffaa2fbd23120921084bf54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 30 Apr 2020 12:56:05 +0200 Subject: Move environment setup to standalone sh file. --- README | 2 +- README.in | 2 +- main | 6 ++++++ module/main.scm | 8 +++----- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100755 main diff --git a/README b/README index ef1eab18..d958cc27 100644 --- a/README +++ b/README @@ -14,7 +14,7 @@ For basic usage, create a file ~/.config/calp/config.scm which (at leasts) calls the f`calendar-files' with a list of files or directories containing ics file. (Both single calendar files, and vdir's are supported, see vdirsyncer and ikhal). Then run: - module/main.scm html --chunked --count 1 + ./main html --chunked --count 1 Which should generate a single HTML-page for the current month. Contributing diff --git a/README.in b/README.in index 1b5515bb..f00fa796 100644 --- a/README.in +++ b/README.in @@ -5,7 +5,7 @@ Calp is primarily a program for loading calendar files (.ics's) from drendering them in different formats. The goal is however to also support fancy filtering, an edit server, and more. The currently working frontends is the HTML-frontend, which have the two main modes of a month-by-month in "week" view, or a table of a single month, and the terminal frontend. The terminatend is mostly for debugging purposes, but it's quite usable still. For basic usage, create a file ~/.config/calp/config.scm which (at leasts) calls the f`calendar-files' with a list of files or directories containing ics file. (Both single calendar files, and vdir's are supported, see vdirsyncer and ikhal). Then run: - module/main.scm html --chunked --count 1 + ./main html --chunked --count 1 Which should generate a single HTML-page for the current month. Contributing diff --git a/main b/main new file mode 100755 index 00000000..2d3e7e4a --- /dev/null +++ b/main @@ -0,0 +1,6 @@ +#!/bin/bash + +here=$(dirname $(realpath $0)) +. $here/env + +exec guile -e main -s $here/module/main.scm "$@" diff --git a/module/main.scm b/module/main.scm index 246e729c..c90adb0c 100755 --- a/module/main.scm +++ b/module/main.scm @@ -1,10 +1,8 @@ -#!/bin/bash -# -*- mode: scheme; geiser-scheme-implementation: guile -*- +;; -*- geiser-scheme-implementation: guile -*- -. $(dirname $(dirname $(realpath $0)))/env +(when (current-filename) + (add-to-load-path (dirname (current-filename)))) -exec guile -e main -s $0 "$@" -!# (use-modules (srfi srfi-1) (srfi srfi-41) -- cgit v1.2.3