Crates.io | copie |
lib.rs | copie |
version | 0.2.0 |
source | src |
created_at | 2021-04-01 03:40:00.438232 |
updated_at | 2021-04-01 21:26:30.487518 |
description | Copies file from or to paths specified in environment variables and command-line. |
homepage | https://github.com/JonathanxD/copie |
repository | https://github.com/JonathanxD/copie |
max_upload_size | |
id | 376444 |
size | 23,267 |
copie a simple tool used by Dracon IntelliJ Plugin to copy content of files that should be opened in an editor through $EDITOR or $VISUAL application to a separated file, allowing them to be inspected and modified without sacrificing integration.
copie works by copying the file specified as first argument into the file specified in COPIE_TO
environment variable, however, when COPIE_FROM
is specified, the data of the file specified by this environment variable is copied into the file specified as first argument. And when both COPIE_FROM
and COPIE_TO
environment variables are set, the contents of the file of the first one is copied into the file of the second one.
Since 0.2.0, contents to write in the file could be specified in COPIE_FROM_STRING
environment variable.
Copies from hello
to a new file test
.
$ touch hello
$ echo 'Hello world' > hello
$ COPIE_TO=test copie hello
Copies from test
to the existing hello
.
$ touch hello
$ echo 'Hello world' > hello
$ touch test
$ echo 'Hello world 2' > test
$ COPIE_FROM=test copie hello
Copies from test
into hello
.
$ touch hello
$ echo 'Hello world' > hello
$ touch test
$ echo 'Hello world 2' > test
$ COPIE_FROM=test COPIE_TO=hello copie
Write copie
string into hello
.
$ COPIE_FROM_STRING=copie COPIE_TO=hello copie
Write copie
string into hello
.
$ COPIE_FROM_STRING=copie copie hello
copie is used in Dracon IntelliJ Plugin to extract record text and to send change text to pijul
, the most common commands are:
COPIE_TO=/a/tmp/dir/RANDOM_HASH VISUAL="copie" pijul record
COPIE_FROM=/a/tmp/dir/RANDOM_HASH VISUAL="copie" pijul record