Commit Graph

50 Commits

Author SHA1 Message Date
Dan OBoyle
a5bf8a5a81 better linting in get_unencrypted_filename() 2015-07-03 17:27:17 -04:00
Dan OBoyle
97030854fa fewer double quotes in fail_if_not_on_cryptlist() 2015-07-03 17:23:34 -04:00
Dan OBoyle
805f66b6b3 Add missing } 2015-07-03 17:21:26 -04:00
Dan OBoyle
38b8ced5dd check if is null before checking for dir 2015-07-03 17:21:00 -04:00
Dan OBoyle
26eb8e48cc Added is_blackbox_repo enumerate_bloackbox_repos and set in change_vcs_root 2015-07-03 13:00:12 -04:00
Dan OBoyle
a648fb8e46 Added / Pruned quotes and separated local variable declaration from assignment. 2015-06-28 19:26:47 -04:00
Dan OBoyle
85e1ea7ccc added quotes to fix linting 2015-06-28 19:05:06 -04:00
Tom Limoncelli
4c7078e4c4 Merge pull request #95 from shadone/blackbox_initialize_ignore_file_fix
Fixed initialization
2015-06-27 13:14:49 -04:00
Denis Dzyubenko
cef09190e9 Allow overriding gpg command
This is particular useful on OS X when gnupg version 2 is installed with brew
which installs it as gpg2
2015-06-27 13:40:45 +02:00
Denis Dzyubenko
c66a0befa6 Fixed initialization
IGNOREFILE variable no longer exists which resulted in calling "vcs_add <empty
string>" command adding all untracked files when blackbox_initialize is called
2015-06-27 13:11:51 +02:00
tlimoncelli@stackexchange.com
efe7bbc8cd Removing the multiple calls to determine VCS type.
* Credit goes to fidian@rumkin.com
2015-06-20 19:10:37 +00:00
Tyler Akins
cc1d7a1851 Removing the multiple calls to determine VCS type
This removed the subshell from _determine_vcs_base_and_type so it can
set environment variables.

Because this always runs at the beginning of the scripts, there's no
need to do checking if REPOBASE is unset or if VCS_TYPE is not yet
determined, thus I simplified one function and eliminated which_vcs.

Conflicts:
	bin/blackbox_deregister_file

I found this easier to just cherry pick since there was a merge and the
merge was reverted.
2015-06-16 17:24:35 -05:00
Tyler Akins
6de7cd99cb Always setting BLACKBOX_HOME
This makes the beginning of all files the same and a little simpler.

`${0%/*}` turns "/home/user/repository/bin/blackbox_edit" into
"/home/user/repository/bin", exactly like basename but without eating a
process.

Because other scripts needed `$blackbox_home` I made this into a
standardard variable that's always available.

This also loads _stack_lib.sh always because _blackbox_common.sh
requires it.
2015-06-16 13:25:55 -05:00
tlimoncelli@stackexchange.com
33429b3ca6 Improve GPG 1.x compatibility. 2015-06-15 20:33:50 +00:00
tlimoncelli@stackexchange.com
c129d06ea0 is_on_cryptlist reversed arguments to file_contains_line() 2015-06-15 20:32:35 +00:00
Tyler Akins
af7db40263 Using make_self_deleting_tempfile
I missed this function earlier
2015-06-15 12:31:50 -05:00
Tyler Akins
287b97ccd6 Pulling greps into a common function
This will help eliminate problems and make searching consistent
2015-06-15 12:29:44 -05:00
Tyler Akins
db9b2eef60 Using """x""" is identical to "x" 2015-06-12 13:27:42 -05:00
Tyler Akins
01e681035d Adding file deregister tool + extrapolating code
This solves some TODOs by moving shared code out into
`_blackbox_common.sh`.

New VCS commands were added, `vcs_ignore` and `vcs_notice` (the
opposite of ignore).

Made some utility functions

* `remove_filename_from_cryptlist` - The opposite of `add_file_to_cryptlist`
* `remove_line` - Removes a single line from a text file
2015-06-12 13:23:45 -05:00
José Luis Lafuente
bef40214b8 Merge remote-tracking branch 'upstream/master' into keyring_new_format 2015-06-02 21:47:23 +02:00
José Luis Lafuente
6489733299 Fix, GnuPG 2.1 keyring default extension is '.kbx' 2015-05-26 12:28:45 +02:00
Mike Dillon
9a0905a139 Send non-file output from blackbox_cat to STDERR 2015-05-14 09:36:13 -07:00
tlimoncelli@stackexchange.com
4a5787cad8 Add support for using the commands outside of a repo. 2015-05-01 15:44:09 +00:00
Stas Alekseev
caf7402a03 Adding support for perforce vcs. 2015-03-23 15:07:26 -04:00
Justin Hart
120f3cb42b use agent for encrypt-decrypt 2015-03-20 17:41:55 -07:00
Charles Prost
a7b8c32da0 [clean] Improve display for filenames with spaces 2015-03-19 11:04:45 +01:00
tlimoncelli@stackexchange.com
225d38ee11 BACKWARDS INCOMPATIBLE CHANGES:
* Using $BASEDIR to pass the location of the repo hasn't worked for a
  while. It has been removed.  Simply cd into the vcs repo before
  running a command.
BUG FIXES:
* .gitignore was being created in subdirectories instead of VCS root.
MINOR CHANGES
* _blackbox_common.sh: Replace change_to_root with change_to_vcs_root
* confidence_test.sh: Added more assertions and tests.
2015-03-10 21:16:27 +00:00
LE Manh Cuong
19532b82d5 Issue 50:
- Fix forgetting unquotes command substitution in function vcs_relative_path.
 - Using old test instead of new test in Makefile.
 - Fix some variables for Bob in "confidence_test.sh".
2015-03-03 09:31:09 +07:00
LE Manh Cuong
5428aed2d7 Fix many bugs for unquote variables. 2015-02-27 01:09:59 +07:00
Tom Limoncelli
27df8eadf0 Merge pull request #42 from jrodriguezjr/master
List files that BlackBox is tracking
2015-02-16 10:59:28 -05:00
Bryan Roberts
63b5dc9de4 Fixed parameter expansion in _blackbox_common.sh for EDITOR 2015-02-15 11:52:34 -05:00
Bryan Roberts
9b5af9f85c Added EDITOR default to _blackbox_common.sh 2015-02-15 02:35:03 -05:00
Joe Rodriguez Jr
1c69a11cdf Changing default umask. 2015-02-11 13:47:00 -06:00
harrison
26ec9319e3 blackbox_shred_all_files now changes to root dir before running. Moved similar code from blackbox_postdeploy into _blackbox_common.sh as change_to_root function. 2014-11-06 00:28:53 -08:00
Ben Drasin
153d34b26f adding cygwin support 2014-10-31 15:15:33 -07:00
bendra
47b9c1a4f2 fix for svnroot 2014-10-18 23:30:38 -07:00
bendra
0c3886df65 inital checkin of svn support 2014-10-15 11:01:52 -07:00
tlimoncelli@stackexchange.com
39f9ffb7df Move code around. No changes 2014-10-13 17:26:41 +00:00
tlimoncelli@stackexchange.com
ead6e96721 Use -- to prevent potential issues with funny file names 2014-10-03 16:25:13 +00:00
mavenlink
fe10053e63 use srm if available, this is OSX's secure remove utility 2014-10-02 16:55:54 -07:00
Tom Limoncelli
2ff15c6daf Merge pull request #19 from christophebiocca/umask
Uses umask to avoid creating world-readable files.
2014-09-25 19:51:44 -04:00
Christophe Biocca
14edf71e83 Uses umask to avoid creating world-readable files. 2014-09-24 00:33:52 -04:00
Christophe Biocca
26800752b4 Puts parens in print call, for python3 compatibility. 2014-09-24 00:13:08 -04:00
tlimoncelli@stackexchange.com
389e8a7a19 BIG CHANGES:
* Command no longer need to be run from the base directory of the repo.
  * blackbox_edit now asks "are you sure?" and is greatly simplified.

_blackbox_common.sh:
  * add_filename_to_cryptlist now accepts paths relative to cwd.
  * fail_if_not_on_cryptlist now accepts paths relative to cwd.
  * new function: vcs_relative_path reports a path to the file relative to the REPOBASE.
  * new function: is_on_cryptlist

plus...
  * Some minor performance enhancesments and cleanups.
  * confidence_test.sh now tests some commands while not in REPOBASE.
2014-09-09 20:32:48 +00:00
tlimoncelli@stackexchange.com
28bff4ff9f Add "set -e" to all scripts. 2014-09-08 20:25:38 +00:00
tlimoncelli@stackexchange.com
3460633506 Fix _determine_vcs_base_and_type and fail_if_not_on_cryptlist 2014-09-08 20:09:04 +00:00
tlimoncelli@stackexchange.com
01a9292d9d Use a portable version of MD5. 2014-09-01 18:59:22 +00:00
Alice Example
d6a20b049f Fix typo that makes vcs_remove fail 2014-09-01 14:26:56 -04:00
tlimoncelli@stackexchange.com
d74eeb33c7 * Initialization for new repos AUTOMATED.
* Adding new users AUTOMATED.
* Update docs for the new, more simplified installation processes.
* Remove dependency on any particular paths, etc.  Copy "bin" into a place along your path and everything should "just work".
* Add support for Mercurial (not tested).
* blackbox_addadmin now adds keys to the keyring for you.
* Unified #! lines to "#!/usr/bin/env bash" so it works better on FreeBSD.
* BUGFIX: (BugId#1) blackbox_update_all_files.sh expects hg, fails for git.
* BUGFIX: (BugId#2) blackbox_postdeploy.sh assumes certain directory layout.
* BUGFIX: Temporary files aren't deleted.
* NEW FILE: bin/blackbox_initialize: Automates enabling BB for a repo (creates directories, files, and updates .gitignore).
* NEW FILE: bin/blackbox_removeadmin: Automates removing an admit.
* NEW FILE: tools/confidence_test.sh: A battery of tests to verify operations.
* NEW FILE: bin/Makefile: Automate package creation.
* NEW FILE: bin/_stack_lib.sh: A library of shell routines from StackExchange.
2014-08-29 20:21:02 +00:00
tlimoncelli@stackexchange.com
f387bc9f30 Remove ".sh" from file names.
Refactor so it does not rely on PWD being the repo basedir.
Fix assumptions about HG and GIT use.
2014-08-28 20:47:32 +00:00