Skip to content

Add support for ASDF_DATA_DIR for a global asdf deployment #7

@DerekK19

Description

@DerekK19

I install asdf (on a Debian web server) in /usr/local/asdf. Then I put all my plugins etc in /opt/asdf. I do this rather than having everything in ~/.asdf. When initialising asdf in my login script I set the env variable ASDF_DATA_DIR to /opt/asdf.

The advantage of this way of working is that every login user on my web server will have the same asdf set-up i.e the web server runner, the deploy user or me if I log onto the web server to triage problems.

When I deploy a web-site using capistrano, there is no mechanism for specifying my custom ASDF_DATA_DIR setting. It would be set in the asdf-wrapper script, but that is created on the fly as par of the deployment.

Please can the gem be modified to support this behaviour. I am thinking of an extra customisation variable (it could be called asdf_custom_data) which would be set in the same way as asdf_custom_path. In my case, I would add lines to deploy.rb like:

set :asdf_custom_path, '/usr/local/asdf'
set :asdf_custom_data, '/opt/asdf'

and this setting would be reflected in the deploy to produce an asdf-wrapper script (in my case) like:

#!/usr/bin/env bash

export ASDF_DATA_DIR="/opt/asdf"

. /usr/local/asdf/asdf.sh
exec "$@"

FWIW I have taken a fork of the repo and made a change as I suggest, and it does work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions