@leverege/build-tools 1.11.4 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,89 @@
1
+ #!/bin/bash
2
+
3
+ # If it isn't already set use the default ~/work/.gitar
4
+ #
5
+ [ -z $GITAR ] && GITAR="${HOME}/.gitar"
6
+
7
+ if [ ! -d $GITAR ]
8
+ then
9
+ cat<<GITAR
10
+
11
+ *** Either set \$GITAR to point to the directory for storing the tarballs
12
+ *** or mkdir $GITAR and we will use that instead.
13
+
14
+ GITAR
15
+ exit 2
16
+ fi
17
+
18
+ TARX="$GITAR/AAA_TarExcludes"
19
+
20
+ # Might be nice to eventually build this up from the .gitignore files or
21
+ # maybe the output from git ls-files --others --ignore --exclude-standard
22
+ if [ ! -f $TARX ]
23
+ then
24
+ cat<<TARX
25
+
26
+ *** Missing $TARX
27
+
28
+ *** This file is used to contain a list of files to exclude from the
29
+ *** tarball. Creating with default list of:
30
+
31
+ *.o
32
+ *.so
33
+ core.*
34
+ node_modules
35
+ TARX
36
+
37
+ cat > $TARX <<DEFX
38
+ *.o
39
+ *.so
40
+ core.*
41
+ node_modules
42
+ DEFX
43
+ fi
44
+
45
+ # Ask git for the root directory of the repository,
46
+ GTOP=`git rev-parse --show-toplevel 2> /dev/null`
47
+
48
+ if [ $? != 0 ];
49
+ then
50
+ cat<<NOGIT
51
+
52
+ *** Are you sure this is a git repository?
53
+
54
+ NOGIT
55
+ exit 2
56
+ fi
57
+
58
+ REPO=`basename ${GTOP}`
59
+
60
+ # Create the repo tarball dir if needed
61
+ #
62
+ [ ! -d $GITAR/$REPO ] && mkdir $GITAR/$REPO
63
+
64
+ # Build a date time string of YYYYMMDD-HHMMSS
65
+ #
66
+ DTS="`date +\"%Y%m%d-%H%M%S\"`"
67
+
68
+ TARB=${GITAR}/${REPO}/${DTS}.tar # Craft the target tarball name.
69
+
70
+ # Now do the work
71
+ #
72
+ cd ${GTOP}/..
73
+ printf "\n*** Tarring $TARB\n"
74
+ tar cf $TARB -X $TARX $REPO
75
+ chmod 0640 $TARB
76
+
77
+ # Do the compression and use xz if it's available
78
+ #
79
+ ZIPPER=bzip2
80
+ FIZ=bz2
81
+ if (type xz 2>&1) >/dev/null
82
+ then
83
+ ZIPPER=xz
84
+ FIZ=xz
85
+ fi
86
+
87
+ printf "*** Compressing $TARB.$FIZ (background)\n\n"
88
+ $ZIPPER $TARB &
89
+ cd - 2>&1 >/dev/null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "1.11.4",
3
+ "version": "1.12.0",
4
4
  "description": "A package for development build tools.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/git-tar ADDED
@@ -0,0 +1,89 @@
1
+ #!/bin/bash
2
+
3
+ # If it isn't already set use the default ~/work/.gitar
4
+ #
5
+ [ -z $GITAR ] && GITAR="${HOME}/.gitar"
6
+
7
+ if [ ! -d $GITAR ]
8
+ then
9
+ cat<<GITAR
10
+
11
+ *** Either set \$GITAR to point to the directory for storing the tarballs
12
+ *** or mkdir $GITAR and we will use that instead.
13
+
14
+ GITAR
15
+ exit 2
16
+ fi
17
+
18
+ TARX="$GITAR/AAA_TarExcludes"
19
+
20
+ # Might be nice to eventually build this up from the .gitignore files or
21
+ # maybe the output from git ls-files --others --ignore --exclude-standard
22
+ if [ ! -f $TARX ]
23
+ then
24
+ cat<<TARX
25
+
26
+ *** Missing $TARX
27
+
28
+ *** This file is used to contain a list of files to exclude from the
29
+ *** tarball. Creating with default list of:
30
+
31
+ *.o
32
+ *.so
33
+ core.*
34
+ node_modules
35
+ TARX
36
+
37
+ cat > $TARX <<DEFX
38
+ *.o
39
+ *.so
40
+ core.*
41
+ node_modules
42
+ DEFX
43
+ fi
44
+
45
+ # Ask git for the root directory of the repository,
46
+ GTOP=`git rev-parse --show-toplevel 2> /dev/null`
47
+
48
+ if [ $? != 0 ];
49
+ then
50
+ cat<<NOGIT
51
+
52
+ *** Are you sure this is a git repository?
53
+
54
+ NOGIT
55
+ exit 2
56
+ fi
57
+
58
+ REPO=`basename ${GTOP}`
59
+
60
+ # Create the repo tarball dir if needed
61
+ #
62
+ [ ! -d $GITAR/$REPO ] && mkdir $GITAR/$REPO
63
+
64
+ # Build a date time string of YYYYMMDD-HHMMSS
65
+ #
66
+ DTS="`date +\"%Y%m%d-%H%M%S\"`"
67
+
68
+ TARB=${GITAR}/${REPO}/${DTS}.tar # Craft the target tarball name.
69
+
70
+ # Now do the work
71
+ #
72
+ cd ${GTOP}/..
73
+ printf "\n*** Tarring $TARB\n"
74
+ tar cf $TARB -X $TARX $REPO
75
+ chmod 0640 $TARB
76
+
77
+ # Do the compression and use xz if it's available
78
+ #
79
+ ZIPPER=bzip2
80
+ FIZ=bz2
81
+ if (type xz 2>&1) >/dev/null
82
+ then
83
+ ZIPPER=xz
84
+ FIZ=xz
85
+ fi
86
+
87
+ printf "*** Compressing $TARB.$FIZ (background)\n\n"
88
+ $ZIPPER $TARB &
89
+ cd - 2>&1 >/dev/null