Closed storge-xx closed 11 years ago
For the first question, let me first say that I am just guessing, but I believe you actually have to commit the .vcf file to the git repository. When the code saves a contact, it appears the following happens:
def save_contact(contact)
@disk.save_contact(contact)
add("#{contact.id}.vcf")
commit("save_contact(#{contact.id})")
end
So, for your case, I'd move the files into ~/contacts and then try:
$ git add .
$ git commit -m "Imported contacts"
EDIT: I tested the above and it seemed to work fine.
For your second question, you need to run the commands verbatim. No need to replace the [address book] with anything. From your ~/contacts, run:
$ echo "[address book]" > ~/.pplconfig
$ echo path = "`pwd`" >> ~/.pplconfig
i'm not sure what i'm doing wrong...
[crunchbang5010:storge] ~ $ rm -fr contacts/
[crunchbang5010:storge] ~ $ ppl init ~/contacts
[crunchbang5010:storge] ~ $ cp .contacts-bkp/*.vcf ~/contacts
[crunchbang5010:storge] ~ $ cd contacts/
[crunchbang5010:storge] ~/contacts $ git add .
[crunchbang5010:storge] ~/contacts $ git commit -m "Imported contacts"
[master b79daca] Imported contacts
34 files changed, 308 insertions(+)
create mode 100644 alex.vcf
create mode 100644 audrey.vcf
create mode 100644 brandy.vcf
create mode 100644 colleen.vcf
create mode 100644 conner.vcf
create mode 100644 craig.vcf
create mode 100644 denise.vcf
create mode 100644 epiphyte.vcf
create mode 100644 erica.vcf
create mode 100644 furphy.vcf
create mode 100644 ginger.vcf
create mode 100644 jannik.vcf
create mode 100644 jasmyne.vcf
create mode 100644 jesus.vcf
create mode 100644 jobin.vcf
create mode 100644 jonathan.vcf
create mode 100644 josh.vcf
create mode 100644 kbone.vcf
create mode 100644 kerensa.vcf
create mode 100644 kori.vcf
create mode 100644 linda.vcf
create mode 100644 lisa.vcf
create mode 100644 mcmanus.vcf
create mode 100644 molly.vcf
create mode 100644 morris.vcf
create mode 100644 mrk.vcf
create mode 100644 sam.vcf
create mode 100644 sarah.vcf
create mode 100644 serena.vcf
create mode 100644 sharr.vcf
create mode 100644 tom.vcf
create mode 100644 tria.vcf
create mode 100644 tuan.vcf
create mode 100644 tyson.vcf
[crunchbang5010:storge] ~/contacts $ ppl ls
test: testy mctest
[crunchbang5010:storge] ~/contacts $
I executed the other commands from the second question as well, thanks.
The only thing I can think of is that you need to make sure that the configuration in ~/.pplconfig is pointed to the correct directory.
$ cat ~/.pplconfig
Mine outputs:
[address book]
path = /Users/tsr/Documents/contacts
Make sure that your's points to your desired contacts folder.
Hope that helps!
[crunchbang5010:storge] ~ $ cat ~/.pplconfig
[address book]
path = /home/storge/contacts
...yep, it points to there. maybe those contacts are doomed and i have to start over. that would make me sad.
...wait, does this have to be run in contacts/ or ~/?
echo "[address book]" > ~/.pplconfig
echo path = "`pwd`" >> ~/.pplconfig
...i thought as a .config file, those would be run in ~/$user. maybe that would confuse it if run in the wrong place? i ask because i don't have a default .pplconfig anywhere. i do have a ~/contacts/.ppl/config but it's an empty file.
...wait, does this have to be run in contacts/ or ~/?
You have to run this in your ~/contacts
directory or wherever you put that directory. If you run echo path = "'pwd'" >> ~/.pplconfig
in ~/
, then it'll write the following to your ~/.pplconfig
:
path = /home/storge
This is because that pwd
in the command is replaced with your current working directory at the time of running the command. In the quick start guide, this works because if you've followed along with the commands then your current working directory will be ~/contacts
.
When I tried to imitate the steps you described - ppl init ~/contacts, copy *.vcf files, commit manually - I actually made this exact mistake. As a result, The output of ppl ls
was empty even though the contacts were in place and committed.
i do have a ~/contacts/.ppl/config but it's an empty file.
You might as well delete this, it doesn't do anything. I'll delete the unused constant referring to it for now: there's currently no repository-level configuration in place. It's something we'll probably want one day but for now there is none.
thank you very much. that worked! all the contacts are integrated now.
It's working? So glad to hear that!
Okay, I'm gonna close this now.
This isn't the first time that this whole ~/.pplconfig
address book path thing has caused confusion. I'm gonna have a think about ways of making this more clear and I'm open to suggestions.
For starters, I think it's time to start a "configuration section" in the documentation. With a page each for things like the address book path, there ought to be enough space to explain things in proper detail.
...maybe just direct as hell.
$ echo "[address book]" > ~/.pplconfig type exactly this while in your contacts directory
$ echo path = "`pwd`" >> ~/.pplconfig type exactly this while in your contacts directory
it's what my thick skull needed ;)
first question: is there a way i can move contacts made in the wrong dir to the address book? i made a mistake and entered about 50 contacts outside of my address book. i tried to move all the $name.vcf into ~/contacts and tried 'ppl ls' but it listed only the two contacts i had in there previously.
second question: what goes in this [bracket] below?
i tried to do this:
but at my next attempt to create a contact, this happened:
...on balance, the first question matters more to me, since it was a lesson learned to be in the right directory the first time. but knowing the second question will save me in the future. thanks again. ~storge
EDIT