Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [Feature] Move files to inside your dotfiles and create symlinks automatically #18

Closed
wants to merge 176 commits into from

Conversation

gtrabanco
Copy link
Owner

Description

This adds new functionality to move files inside your dotfiles and apply a symlink "automatically" and preserve those changes inside your dotfiles. New symlink is applied automatically.

Motivation

Makes more simple and faster to move files inside your dotfiles. This also removes the need of modify your conf.yaml file which is easy to make format errors while editing manually without an editor.

Fixes

New core libraries

files.sh

This is from PR #129 and it is documented there

files::check_if_path_is_older function is not used in this branch but I expect PR #129 to be approved and keep this file as it is there. It is a consistency decision.

dot.sh

Added functions to load libraries that is from PR #129 and it is documented there

output.sh

This is from PR #129 and it is full documented there

New Features

json.sh

  • json::to_yaml convert json to yaml

yaml.sh

  • yaml::to_json convert yaml file to json to manipulate it with jq command

New commands

All these command use symlinks/conf.yaml by default if not argument like --yaml=conf.linux is given. You can also provide a custom path to yaml file like --yaml="/path/to/my.yaml". It should respect the dotbot yaml format. If it is an empty file it will create the necessary directive.

See the help for more options of all command because do more stuff all of them.

lazy symlinks link

Move a file in your current work directory in your console to the given path inside your DOTFILES_PATH (relative path).

lazy symlinks edit

Edit a current link to a new one and apply it.

lazy symlinks delete

Delete a symlink and the stored file.

lazy symlinks restore

Move from dotfiles to the link path (destroy the symlink and preserve the file in the deleted link).

Modified commands

lazy self install

Added a way to backup files.

lazy symlinks apply

Added silent mode.

Other modifications in this feature

Modified how symlinks are applied. Now there are "system" (dotly) symlinks and user symlinks. Stuff that are necessary for dotly to set up as symbolic links are now inside dot self install context folder. This mean that dotfiles_template were modified as well to split symlinks yaml files.

Modified self install to install yq.

Modified update_all to update yq.

Tasks

  • Add needed core libraries from feature/core (only needed parts).
  • Add new core libraries.
  • Backup when using dot self install.
  • Add link symlinks script.
  • Add edit symlinks script.
  • Add delete symlinks script.
  • Add restore symlinks script.
  • Install yq.
  • Add yq to update all.
  • Document in this PR all new stuff.
  • Manual testing.

gtrabanco and others added 30 commits February 13, 2021 17:45
…res/fixes in other PRs. Added feature of autoupdate dotly
…otly, fixed all the way init-scripts were loaded because they fail. Fixed some issues.
* Added new functions to get the current script_name or script_path where the functions were run
* Added function to conver mayus to lower
`mas` has added support for Apple Silicon: mas-cli/mas#310
…led (#107)

Co-authored-by: David Asensio Cañas <david.asensio@lifullconnect.com>
In case of having multiple Cargo dependencies installed such as:

```sh
{▸} ~ cargo install --list
docpars v0.2.0:
    docpars
git-delta v0.6.0:
    delta
```

The previous command was passing out multiple lines:

```sh
{▸} ~ cargo install --list | grep -E '^[a-z0-9_-]+ v[0-9.]+:$' | cut -f1 -d' '
docpars
git-delta
```

Because of these lines were being received by the very same `cargo install` command, it was failing:

```sh
{▸} ~ cargo install "$(cargo install --list | grep -E '^[a-z0-9_-]+ v[0-9.]+:$' | cut -f1 -d' ')"
    Updating crates.io index
error: could not find `docpars
git-delta` in registry `https://github.com/rust-lang/crates.io-index` with version `*`
```

Now, it executes the `cargo install` multiple times, but at least do not produce crashes 😅

```sh
{▸} ~ cargo install --list | grep -E '^[a-z0-9_-]+ v[0-9.]+:$' | cut -f1 -d' ' | xargs -n1 cargo install
    Updating crates.io index
     Ignored package `docpars v0.2.0` is already installed, use --force to override
    Updating crates.io index
     Ignored package `git-delta v0.6.0` is already installed, use --force to override
```
Having pip3 installed does not imply having defined any dependencies for python. This change avoids crashing while running the `up` command. We were crashing because of the combination of `set -euo pipefail` with an empty input for the `grep -v '^\-e'` 🤟
Added script 'dot symlinks update'
* Fix errors with symlinks update script when files are symbolic links
* Fix non alphanumeric names of files
…ates can apply its own symlinks without adding files in symlinks subfolder
…so use it without copying files to the init-scripts folder

Added a CHANGELOG
* When you have problems of file permissions of autocompletions or any zsh file
  you can solve those errors by executing this subcommand.
Merged official dotly master branch in this branch.
@gtrabanco gtrabanco added the enhancement New feature or request label Jun 25, 2021
@gtrabanco gtrabanco self-assigned this Jun 25, 2021
@gtrabanco
Copy link
Owner Author

Requires

#17

@gtrabanco gtrabanco added this to the v4 milestone Aug 4, 2021
@github-actions
Copy link

github-actions bot commented Sep 4, 2021

This PR is stale because it has been opened for 30 days with no activity.

@github-actions github-actions bot added the stale label Sep 4, 2021
@github-actions
Copy link

This PR was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants