1
0
Fork 0
mirror of synced 2024-12-04 14:45:36 -05:00

Compare commits

...

9 commits

Author SHA1 Message Date
LiteLotus
85dd60d873
Merge 69f6dbeebc into 144f35b82d 2024-11-06 17:07:13 -05:00
Erik Flodin
144f35b82d
Update links under .github/ to point to new github org 2024-11-04 23:12:28 +01:00
Lamar Daughma
69f6dbeebc switched to better function replacement 2022-01-28 17:30:18 +00:00
Lamar Daughma
9ed1af1fab Merge branch 'master' of github.com:Lite5h4dow/yadm 2022-01-28 13:01:08 +00:00
Lamar Daughma
04544b4d8f removing dead space 2022-01-28 13:00:24 +00:00
LiteLotus
89d7df0d1b
Merge branch 'TheLocehiliosan:master' into master 2022-01-28 12:57:52 +00:00
Lamar Daughma
c6b4bde04c finishing vars print 2022-01-28 12:36:00 +00:00
Lamar Daughma
cee2b5753c adding better variable detection 2022-01-28 11:17:17 +00:00
Lamar Daughma
7b76dabe7b adding verify command 2021-11-24 15:49:00 +00:00
8 changed files with 132 additions and 27 deletions

View file

@ -1,7 +1,7 @@
# Introduction
Thank you for considering contributing to **yadm**. I develop this project in my
limited spare time, so help is very appreciated.
Thank you for considering contributing to **yadm**. We develop this project in
our limited spare time, so help is very appreciated.
All contributors must follow our [Code of Conduct][conduct]. Please make sure
you are welcoming and friendly during your interactions, and report any
@ -17,7 +17,8 @@ To contribute, you can:
* Star the yadm repo, the star count helps others discover yadm.
* Report [bugs](#reporting-a-bug)
* Request [features/enhancements](#suggesting-a-feature-or-enhancement)
* Contribute changes to [code, tests](#contributing-code), and [documentation](#improving-documentation)
* Contribute changes to [code, tests](#contributing-code), and
[documentation](#improving-documentation)
* Maintain installation [packages](#maintaining-packages)
* Help other users by [answering support questions](#answering-support-questions)
@ -70,14 +71,14 @@ Consider trying to reproduce the bug inside a docker container using the
[yadm/testbed][] docker image. Doing so will greatly increase the likelihood of
the problem being fixed.
The easiest way to start this container, is to clone the [TheLocehiliosan/yadm
The easiest way to start this container, is to clone the [yadm
repo][yadm-repo], and use the `scripthost` make target. _(You will need `make`
and `docker` installed.)_
For example:
```text
$ git clone https://github.com/TheLocehiliosan/yadm.git
$ git clone https://github.com/yadm-dev/yadm.git
$ cd yadm
$ make scripthost version=1.12.0
Starting scripthost version="1.12.0" (recording script)
@ -203,7 +204,7 @@ these principles when making changes.
3. Add the official repository (`upstream`) as a remote repository.
```text
$ git remote add upstream https://github.com/TheLocehiliosan/yadm.git
$ git remote add upstream https://github.com/yadm-dev/yadm.git
```
4. Verify you can run the test harness. _(This will require dependencies:
@ -361,25 +362,24 @@ see if you can help.
[attach-help]: https://help.github.com/en/articles/file-attachments-on-issues-and-pull-requests
[commit-style]: https://chris.beams.io/posts/git-commit/#seven-rules
[conduct]: CODE_OF_CONDUCT.md
[contrib-hooks]: https://github.com/TheLocehiliosan/yadm/tree/master/contrib/hooks
[contrib-hooks]: https://github.com/yadm-dev/yadm/tree/master/contrib/hooks
[flake8]: https://pypi.org/project/flake8/
[groff-man]: https://www.gnu.org/software/groff/manual/html_node/man.html
[hooks-help]: https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md#hooks
[hooks-help]: https://github.com/yadm-dev/yadm/blob/master/yadm.md#hooks
[html-proofer]: https://github.com/gjtorikian/html-proofer
[jekyll]: https://jekyllrb.com
[new-bug]: https://github.com/TheLocehiliosan/yadm/issues/new?template=BUG_REPORT.md
[new-feature]: https://github.com/TheLocehiliosan/yadm/issues/new?template=FEATURE_REQUEST.md
[open-issues]: https://github.com/TheLocehiliosan/yadm/issues
[new-bug]: https://github.com/yadm-dev/yadm/issues/new?template=BUG_REPORT.md
[new-feature]: https://github.com/yadm-dev/yadm/issues/new?template=FEATURE_REQUEST.md
[open-issues]: https://github.com/yadm-dev/yadm/issues
[pr-help]: https://help.github.com/en/articles/creating-a-pull-request-from-a-fork
[pylint]: https://pylint.org/
[pytest]: https://pytest.org/
[questions]: https://github.com/TheLocehiliosan/yadm/labels/question
[refactor]: https://github.com/TheLocehiliosan/yadm/issues/146
[questions]: https://github.com/yadm-dev/yadm/labels/question
[shellcheck]: https://www.shellcheck.net
[signing-commits]: https://help.github.com/en/articles/signing-commits
[tpope-style]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[yadm-man]: https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md
[yadm-repo]: https://github.com/TheLocehiliosan/yadm
[yadm-man]: https://github.com/yadm-dev/yadm/blob/master/yadm.md
[yadm-repo]: https://github.com/yadm-dev/yadm
[yadm/jekyll]: https://hub.docker.com/r/yadm/jekyll
[yadm/testbed]: https://hub.docker.com/r/yadm/testbed
[yamllint]: https://github.com/adrienverge/yamllint

View file

@ -1,6 +1,6 @@
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
https://github.com/yadm-dev/yadm/issues to avoid duplication.
If you have found a security vulnerability, do NOT open an issue.
Email yadm@yadm.io instead.

View file

@ -8,7 +8,7 @@ assignees: ''
---
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
https://github.com/yadm-dev/yadm/issues to avoid duplication.
If you have found a security vulnerability, do NOT open an issue.
Email yadm@yadm.io instead.
@ -25,10 +25,10 @@ Can this be reproduced with the yadm/testbed docker image: [Yes/No]
Consider trying to reproduce the bug inside a docker container using the
yadm/testbed docker image. https://hub.docker.com/r/yadm/testbed
The easiest way to start this container, is to clone the TheLocehiliosan/yadm
The easiest way to start this container, is to clone the yadm-dev/yadm
repo, and use the "scripthost" make target. For example:
$ git clone https://github.com/TheLocehiliosan/yadm.git
$ git clone https://github.com/yadm-dev/yadm.git
$ cd yadm
$ make scripthost version=1.11.0
Starting scripthost version="1.11.0" (recording script)

View file

@ -8,7 +8,7 @@ assignees: ''
---
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
https://github.com/yadm-dev/yadm/issues to avoid duplication.
-->
### Is your feature request related to a problem? Please describe.

View file

@ -8,7 +8,7 @@ assignees: ''
---
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
https://github.com/yadm-dev/yadm/issues to avoid duplication.
-->
### This issue is about

View file

@ -8,11 +8,11 @@ assignees: ''
---
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
https://github.com/yadm-dev/yadm/issues to avoid duplication.
Please also consult:
* The FAQ: https://yadm.io/docs/faq
* The manual: https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md
* The manual: https://github.com/yadm-dev/yadm/blob/master/yadm.md
-->
### This question is about

View file

@ -29,6 +29,6 @@ Be sure to preface the issue/PR numbers with a "#".
Please review [yadm's Contributing Guide][3] for best practices.
[1]: https://github.com/TheLocehiliosan/yadm/blob/master/.github/CONTRIBUTING.md#test-conventions
[1]: https://github.com/yadm-dev/yadm/blob/master/.github/CONTRIBUTING.md#test-conventions
[2]: https://help.github.com/en/articles/signing-commits
[3]: https://github.com/TheLocehiliosan/yadm/blob/master/.github/CONTRIBUTING.md
[3]: https://github.com/yadm-dev/yadm/blob/master/.github/CONTRIBUTING.md

109
yadm
View file

@ -99,7 +99,7 @@ function main() {
# parse command line arguments
local retval=0
internal_commands="^(alt|bootstrap|clean|clone|config|decrypt|encrypt|enter|git-crypt|help|--help|init|introspect|list|perms|transcrypt|upgrade|version|--version)$"
internal_commands="^(alt|bootstrap|clean|clone|config|decrypt|encrypt|enter|echo|git-crypt|help|--help|init|introspect|list|perms|transcrypt|upgrade|version|--version)$"
if [ -z "$*" ] ; then
# no argumnts will result in help()
help
@ -144,7 +144,7 @@ function main() {
[ ! -d "$YADM_WORK" ] && error_out "Work tree does not exist: [$YADM_WORK]"
HOOK_COMMAND="$YADM_COMMAND"
invoke_hook "pre"
$YADM_COMMAND "${YADM_ARGS[@]}"
${YADM_COMMAND/echo/yecho} "${YADM_ARGS[@]}"
else
# any other commands are simply passed through to git
HOOK_COMMAND="$1"
@ -1173,6 +1173,7 @@ Commands:
yadm enter [COMMAND] - Run sub-shell with GIT variables set
yadm git-crypt [OPTIONS] - Run git-crypt commands for the yadm repo
yadm transcrypt [OPTIONS] - Run transcrypt commands for the yadm repo
yadm echo [OPTIONS] - View yadm internal commands and file paths
Files:
\$HOME/.config/yadm/config - yadm's configuration file
@ -1459,6 +1460,110 @@ function version() {
}
function print_variables(){
local local_class
local local_system
local local_host
local local_user
local local_distro
set_local_alt_values
if [[ -z "$2" ]]; then
echo "Yadm variables:
distro=$local_distro
system=$local_system
hostname=$local_host
user=$local_user
class=$local_class
"
else
case "$2" in
class)
echo $local_class
;;
system)
echo $local_system
;;
host)
echo $local_host
;;
user)
echo $local_user
;;
distro)
echo $local_distro
;;
*)
echo "$2 is not a valid option"
esac
fi
}
function print_paths(){
if [[ -z "$2" ]] ; then
echo "yadm paths:
repo=$YADM_REPO
yadm_dir=$YADM_DIR
config=$YADM_CONFIG
encrypt=$YADM_ENCRYPT
archive=$YADM_ARCHIVE
"
else
case "$2" in
repo)
echo $YADM_REPO
;;
dir|yadm_dir)
echo $YADM_DIR
;;
config)
echo $YADM_CONFIG
;;
encrypt)
echo $YADM_ENCRYPT
;;
archive)
echo $YADM_ARCHIVE
;;
*)
echo " in path "
echo "$2 is not a valid option"
esac
fi
}
function yecho() {
#verify internal yadm variables
if [[ $# -eq 0 ]] ; then
print_variables
print_paths
fi
while [[ $# -gt 0 ]] ; do
case "$1" in
vars|variables)
print_variables "${YADM_ARGS[@]}"
if [[ ! -z "$2" ]] ; then
shift
fi
;;
paths|path)
print_paths "${YADM_ARGS[@]}"
if [[ ! -z "$2" ]] ; then
shift
fi
;;
*)
echo "$1 is not a valid command"
;;
esac
shift
done
}
# ****** Utility Functions ******
function exclude_encrypted() {