These are chat archives for ellipsis/ellipsis

13th
Jan 2016
Gertjan Roggemans
@groggemans
Jan 13 2016 22:33
i'm going to take a look at the linking tomorrow. The most intuitive would be to let fs.link_file link without dot, and fs.link_dotfile with a dot. But this would brake all current ellipsis.sh implementations. So i assume you're not a fan of that.. any suggestions?
Zach Kelling
@zeekay
Jan 13 2016 22:34
I don't know, might possibly just special-case a few things and make it work both ways
it's pretty easy to support both
I was thinking it'd just add a dot if missing
if dot- is prefix swap with .
otherwise leave . as is
that would support the three common patterns
There is probably a short list of files we should exclude
.git, .gitattributes, etc
Maybe I'm weird but I've always kept my dotfiles sans .
I used dot- before I just skipped it
I've seen all three approaches
maybe just add a global exclude var?
so that people can just declare the things not to link
Gertjan Roggemans
@groggemans
Jan 13 2016 22:46
The auto linking is good as is for me, even auto prepending the dot, the problem i'm having is with manual linking. I would like to benefit from the backup feature fs.link_file provides. But fs.link_fileprepends a dot by default (a little counter intuitive). So for me the solution would be to add an fs.link_file version that doesn't adds a dot or changing the fs.link_file function en call it this way when auto linking fs.link_file ".$filename".
Zach Kelling
@zeekay
Jan 13 2016 22:47
or have it just work in all three situations?
i use it a lot like
fs.link_file $PKG_PATH
which depends on it pre-pending the .
with manual linking you can specify the exact path, not sure if that helps
Gertjan Roggemans
@groggemans
Jan 13 2016 22:50
This is what i want to avoid;
fs.backup ~/.config/nvim/init.vim
ln -s $PKG_PATH/vimrc ~/.config/nvim/init.vim
Zach Kelling
@zeekay
Jan 13 2016 22:52
link_file will back it up for you
so you can just do
fs.link_file $PKG_PATH/vimrc ~/.config/nvim/init.vim
so what's your ideal?
Gertjan Roggemans
@groggemans
Jan 13 2016 22:56
wouldn't this also add the dot? local dest="${2:-$ELLIPSIS_HOME}/.$name" << dot before the $name, or am i missing something?
Zach Kelling
@zeekay
Jan 13 2016 22:57
no
it uses $2 by default
the second argument overrides that
if you manually specify the location it just uses that
${want:-fallback}
Gertjan Roggemans
@groggemans
Jan 13 2016 23:03
yes, $2 overrides the $ELLIPSIS_HOME , but does it also ignore the /.$name?
Zach Kelling
@zeekay
Jan 13 2016 23:03
$2 is used explicitly
it only does the . as a default
if you specify the location it's used precisely, no monkeying about (if you know where you want it, we respect that)
Gertjan Roggemans
@groggemans
Jan 13 2016 23:17
I tested the syntax, and as i expected, the part behind the curly braces is always appended.. So i must be getting tired and missing something obvious or i'm not explaining myself very well :worried:

!/usr/bin/env bash

DEFAULT="This is a t"
test="${2:-$DEFAULT}est"
echo "$test"
Zach Kelling
@zeekay
Jan 13 2016 23:17
oh
no my bad
Gertjan Roggemans
@groggemans
Jan 13 2016 23:17
if u run this script without params i get "this is a test" if i run it with arguments test and t i get test
Zach Kelling
@zeekay
Jan 13 2016 23:18
yea
ofc
sorry that's a bug in fs.link_file
Gertjan Roggemans
@groggemans
Jan 13 2016 23:18
glad we finally got on the same line :smile: :+1:
Zach Kelling
@zeekay
Jan 13 2016 23:18
i thought it was
local dest="${2:-$ELLIPSIS_HOME/.$name}"
i actually use it like that
so that explains a lot
Gertjan Roggemans
@groggemans
Jan 13 2016 23:20
That's how i found out, tried one of your configs and saw a bad link (your init.vim for nvim)
Zach Kelling
@zeekay
Jan 13 2016 23:20
weird
i guess i don't even test that usage
yea
that's a bug
it was supposed to work the way i said
didn't test that usage
so my bad
yeah that explains why that file never is linked right
i've fixed that before
and just didn't think about it
lol
Gertjan Roggemans
@groggemans
Jan 13 2016 23:22
np, the way it's supposed to work also solves my issues! :smile:
Zach Kelling
@zeekay
Jan 13 2016 23:24
ok fixed
Gertjan Roggemans
@groggemans
Jan 13 2016 23:25
great! :+1:
for me the issue about the more intuitive linking + dot option can be closed, although it's still a little counter intuitive the way it is :smile:
Zach Kelling
@zeekay
Jan 13 2016 23:28
Yeah, should support those three approaches still i think
doesn't make sense to add . unless it's missing, if nothing else