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

direnv: error invalid line #1210

Open
cdenneen opened this issue Dec 6, 2023 · 0 comments
Open

direnv: error invalid line #1210

cdenneen opened this issue Dec 6, 2023 · 0 comments
Labels

Comments

@cdenneen
Copy link

cdenneen commented Dec 6, 2023

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

.envrc:

#!/bin/bash

# readarray -td\/ array <<<"$PWD"; declare -p array
# MYPATH=$(pwd)
# readarray -d / -t array < <(printf "%s" "$MYPATH")
# IFS=/ read -d "" -r -a array < <(printf "%s" "$MYPATH")
IFS='/ ' read -r -a array <<< "$PWD"

array=("${array[@]:1}")

returns:

declare -a array=([0]="home" [1]="ec2-user" [2]="src" [3]="eks-live" [4]="capdev" [5]="us-east-1" [6]="cdtest")
direnv: error invalid line: IFS='/ ' read -r -a array <<< "$PWD"

I've tried many different ways of doing that but all provide that same result. It actually is working further in the script the array is fine and does what I need it but the error is a bit frustrating.

even if I have declare -a array I get same error:

direnv: error invalid line: declare -a array

Expected behavior
A clear and concise description of what you expected to happen.

No errors produced

Environment

  • OS: [e.g. macOS Mojave, Ubuntu 18.04, ...] Amazon Linux 2
  • Shell: [e.g. bash, zsh, ...] bash
  • Direnv version [e.g. 2.20.0] 2.33.0

Additional context
Add any other context about the problem here.

@cdenneen cdenneen added the Bug label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant