Cd command not working in bash


#1

I need some basic if else logic and decided to do it in bash.

But seems all cd commands don’t work.

I get the error:

AppDeploy.sh: 18: cd: can't cd to ~/xx/yyy/zzzz
Buildfile: build.xml does not exist!
Build failed

the same script works locally.


#2

Pro-tip: if your code doesn’t work, then show that code (or a relevant part of it).


#3

There are two reasons I can think of (and do show your code):

  1. ~/xx/yyy/zzzz doesn’t exist (You probably need to mkdir it)
  2. It exists, but some element of the path is not readable by the user running circleci tests

Use the circleci ssh feature to log and experiment, running your AppDeploy.sh.

Oh, and use “set -x” in your AppDeploy.sh so you can see what was going on.

And as the other commentor said… Include a bit of the code if you’re going to ask for help.


#4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.