all repos — dotfiles @ 44c1b8b751c98f9b1f38d40439d30c68ae2805d8

my *nix dotfiles

bin/nim-proj (view raw)

 1#!/usr/bin/env bash
 2
 3# nim-proj.sh: initializes 
 4
 5help() {
 6	echo "Usage:"
 7	echo "nim-proj <name> <description>"
 8}
 9
10if [ $# -eq 2 ]; then
11	nimble init $1
12	cd $1
13	
14	cat <<- EOF > readme.md
15	# $1
16	> $2
17	EOF
18	
19	cat <<- "EOF" > .travis.yml
20	language: c
21	
22	cache: ccache
23	cache:
24	    directories:
25	        - .cache
26	
27	matrix:
28	    include:
29	        - os: linux
30	          env: CHANNEL=stable
31	          compiler: gcc
32	
33	        - os: linux
34	          env: CHANNEL=devel
35	          compiler: gcc
36	
37	        - os: osx
38	          env: CHANNEL=stable
39	          compiler: clang
40	
41	    allow_failures:
42	        - env: CHANNEL=devel
43	        - os: osx
44	
45	    fast_finish: true
46	
47	env:
48	    global:
49	        - PROGNAME="$(basename ${TRAVIS_BUILD_DIR})"
50	        - NIMFILE="src/${PROGNAME}.nim"
51	        - BINFILE="src/${PROGNAME}"
52	        - ASSETFILE="${PROGNAME}-${TRAVIS_TAG}-linux64"
53	
54	install:
55	    - export CHOOSENIM_NO_ANALYTICS=1
56	    - curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
57	    - sh init.sh -y
58	    - export PATH=~/.nimble/bin:$PATH
59	    - echo "export PATH=~/.nimble/bin:$PATH" >> ~/.profile
60	    - choosenim $CHANNEL
61	
62	script:
63	    - cd "${TRAVIS_BUILD_DIR}"
64	    - nim c "${NIMFILE}" 
65	    - "${BINFILE}" 
66	
67	before_deploy:
68	    - cd "${TRAVIS_BUILD_DIR}"
69	    - cp "${BINFILE}" "${ASSETFILE}"
70	deploy:
71	    provider: releases
72	    api_key: "${GITHUB_OAUTH_TOKEN}"
73	    file: "${ASSETFILE}"
74	    skip_cleanup: true
75	    on:
76	    tags: true	
77	EOF
78
79	git init
80else
81	help
82fi