Skip to content

Using $HOME in the aria2 conf file #780

@myme5261314

Description

@myme5261314

I'm writing my cross-platform (say OSX and Ubuntu) automation deployment script. Aria2 is one component of it.
Here I face the embarrassed situation: the $HOME couldn't be used in the aria2's conf file while can be used in the terminal command line argument.
Say, run the command below in the terminal

aria2c --conf-path=$HOME/.aria2/aria2-chrome.conf

will give me this error:

Exception caught
Exception: [download_helper.cc:528] errorCode=1 Failed to open the file ${HOME}/.aria2/aria2-chrome.session, cause: No such file

or $HOME will fail either.

The thing is the file do exist, if I replace $HOME with absolute path in the conf file, all things will be ok.

As you may noticed that $HOME under OSX is something like /Users/username while under Ubuntu is something like /home/username. Surely, I can prepare for two version of conf file for this two OS.

Is there any other elegant solution?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions