about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-07-14 04:16:22 -0400
committerCharadon <dev@iotib.net>2022-07-14 04:16:22 -0400
commitfbccc58abece3004b7d4912d5df331292db6dcaf (patch)
tree8a45ff1e08ebb2da4e63bbb5f43817117b79698a
parentf45c47112bd5561dc74797bc7bac02dc59d92bda (diff)
downloaddscip-fbccc58abece3004b7d4912d5df331292db6dcaf.tar.gz
Fixed portability issue, and made git only clone the most recent commit with no history.
-rw-r--r--config.sh2
-rwxr-xr-xdscip13
2 files changed, 8 insertions, 7 deletions
diff --git a/config.sh b/config.sh
index c78e95e..321235b 100644
--- a/config.sh
+++ b/config.sh
@@ -7,7 +7,7 @@ DSCIP_GITREPO="https://www.example.com/example/example.git"
 DSCIP_GITMODE="clone"
 # Branch to check #
 DSCIP_BRANCH="master"
-WORKING_DIRECTORY="$(dirname $(realpath $0))"
+WORKING_DIRECTORY="$(pwd -P)"
 # Commands to run before building. #
 DSCIP_PRE_CMD="$WORKING_DIRECTORY/pre.sh"
 # Commands to run to build program. #
diff --git a/dscip b/dscip
index db7726e..61208a0 100755
--- a/dscip
+++ b/dscip
@@ -17,7 +17,8 @@
 ################################################################################
 
 set -e
-. "$(dirname "$(realpath "$0")")/config.sh"
+cd "$(dirname "$0")"
+. "$(pwd -P)/config.sh"
 
 ################################################################################
 
@@ -65,10 +66,10 @@ echo "DSCIP_OUTPUT_TO=$DSCIP_OUTPUT_TO"
 build () {
 	if [ "$DSCIP_GITMODE" = "clone" ]; then
 		rm -rf "$WORKING_DIRECTORY/wrkdir" # Clean Up #
-		git clone -b "$DSCIP_BRANCH" "$DSCIP_GITREPO" wrkdir >> "$DSCIP_OUTPUT_TO" 2>&1 # Clone git #
+		git clone --depth 1 -b "$DSCIP_BRANCH" "$DSCIP_GITREPO" wrkdir >> "$DSCIP_OUTPUT_TO" 2>&1 # Clone git #
 	elif [ "$DSCIP_GITMODE" = "pull" ]; then
 		if [ ! -d "$WORKING_DIRECTORY/wrkdir" ]; then
-			git clone -b "$DSCIP_BRANCH" "$DSCIP_GITREPO" wrkdir >> "$DSCIP_OUTPUT_TO" 2>&1
+			git clone --depth 1 -b "$DSCIP_BRANCH" "$DSCIP_GITREPO" wrkdir >> "$DSCIP_OUTPUT_TO" 2>&1
 		fi
 		cd wrkdir
 		git pull >> "$DSCIP_OUTPUT_TO" 2>&1
@@ -79,13 +80,13 @@ build () {
 	{
 		cd "$WORKING_DIRECTORY/wrkdir";
 		echo "Running pre-build commands...";
-		$DSCIP_PRE_CMD;
+		"$DSCIP_PRE_CMD";
 		echo "Running build commands...";
 		cd "$WORKING_DIRECTORY/wrkdir";
-		$DSCIP_BUILD_CMD;
+		"$DSCIP_BUILD_CMD";
 		echo "Running post-build commands...";
 		cd "$WORKING_DIRECTORY/wrkdir";
-		$DSCIP_POST_CMD;
+		"$DSCIP_POST_CMD";
 	} >> "$DSCIP_OUTPUT_TO" 2>&1
 	echo "$CURRENT_COMMIT" > "$WORKING_DIRECTORY/LAST_COMMIT" # Save commit #
 }
='Blame the previous revision' href='/gbmor/clinte/blame/README.md?h=v2.0.0&id=288614bd7a38affc04d6ecea21a972a41c19ceb2'>^
f3c7809 ^


a2ca864 ^
f3c7809 ^



2a3d402 ^
a2ca864 ^
2a3d402 ^


a2ca864 ^
2a3d402 ^

df6f3d1 ^





31c907b ^


a2ca864 ^









31c907b ^


a2ca864 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
                                                                                                                                                                                                                                              
 
                                                                              
 

           






                                                               
 
                                                                                                                                             




                                          

                       

























                                                                             
                                    
 



        









                                                                                    
               
 


               
 



                                                                              
                 
 


               
 

                                                            





                                                                               


                                                                       









                                                                      


                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
# clinte &nbsp; [![Build Status](https://travis-ci.com/gbmor/clinte.svg?branch=master)](https://travis-ci.com/gbmor/clinte) [![codecov](https://codecov.io/gh/gbmor/clinte/branch/master/graph/badge.svg)](https://codecov.io/gh/gbmor/clinte)

Command-line community notice board. Post simple notes for other users to see.

## Features

- Username is tagged based on the executing user
- Shows the 15 most recent posts in descending order
- Able to go back and edit your own posts
- Title <= 30 chars
- Body <= 500 chars
- Calls `$EDITOR` when creating or modifying the body of a post
- If `$EDITOR` is unset, calls `nano`

[![Screenshot](https://github.com/gbmor/clinte/blob/master/assets/clinte.png)](https://github.com/gbmor/clinte/blob/master/assets/clinte.png)

## Installation

Current build dependencies are as follows:

- `rustc/cargo >= 1.36`
- `libsqlite3-dev`

The installation for the build deps will vary based on your OS (`Linux, BSD`)

Clone the repository and jump into the directory:

```
$ git clone git://github.com/gbmor/clinte.git
...
$ cd clinte
```

Run the makefile and install:

```
$ make
...
...Done!

$ sudo make install
```

## Usage

Issuing the program name itself will list
the currently available posts, like in the screenshot above.

To display the 15 most recent posts:

```
$ clinte
```

To make a new post:

```
$ clinte post
```

`clinte` will then ask for the title of the post, and the body. The username will be
tagged automatically by your logged-in username, reflecting its intended use on
multi-user UNIX-like systems.

To edit a post:

```
$ clinte update
```

`clinte` will ask for the ID number of the post. If it's been authored by you,
then you will be asked for the new title and body after being shown the
previous title and body.

To delete a post:

```
$ clinte delete
```

Then `clinte` asks for the numeric ID of the post to delete.

## Contributing

This is very new, so feel free to hack on it in any way you
please and submit a PR! I'll be working on it myself over the next several days
to flesh it out.

## Notes

`clinte` has roughly 60 library dependencies from the `rust` ecosystem.
Nevertheless, the binary remains only `2.1MB` in size as of `v0.4.3`.
For your information, the direct library dependencies of `clinte` are:

- `chrono >= 0.4`
- `clap >= 2.33`
- `lazy_static >= 1.4`
- `log >= 0.4`
- `rusqlite >= 0.20`
- `simplelog >= 0.7`
- `users >= 0.9`

The indirect dependencies (dependencies of dependencies) are:

`ansi_term, arrayref, arrayvec, atty, autocfg, backtrace, backtrace-sys, base64, bitflags, blake2b_simd, byteorder, cc, cfg-if, cloudabi, constant_time_eq, crossbeam-utils, dirs, dirs-sys, failure, failure_derive, fallible-iterator, fallible-streaming-iterator, fuchsia-cprng, libc, libsqlite3-sys, linked-hash-map, lru-cache, memchr, nodrop, num-integer, num-traits, pkg-config, proc-macro2, quote, rand_core, rand_os, rdrand, redox_syscall, redox_users, rust-argon2, rustc-demangle, strsim, syn, synstructure, term, textwrap, time, unicode-width, unicode-xid, vcpkg, winapi, winapi-i686-pc-windows-gnu, winapi-x86_64-pc-windows-gnu`