Page MenuHome

Do not request elevated rights when creating directory in owned directory.
ClosedPublic

Authored by Andreas Bergmeier (abergmeier) on Oct 30 2015, 9:10 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Andreas Bergmeier (abergmeier) retitled this revision from to Do not request elevated rights when creating directory in HOME directory..
Andreas Bergmeier (abergmeier) updated this object.
Andreas Bergmeier (abergmeier) set the repository for this revision to rB Blender.

The script could try to make the directory, and only resort to sudo if it can't be created.

eg:

mkdir -p $INST 2> /dev/null
if [ ! -d $INST ]; then

@Bastien Montagne (mont29), what do you think?

The script could try to make the directory, and only resort to sudo if it can't be created.

eg:

mkdir -p $INST 2> /dev/null
if [ ! -d $INST ]; then

@Bastien Montagne (mont29), what do you think?

Question then is, why not simply do:

mkdir -p $INST 2> /dev/null
$SUDO mkdir -p $INST 2> /dev/null
if [ ! -d $INST ]; then
  # rights issue
Andreas Bergmeier (abergmeier) retitled this revision from Do not request elevated rights when creating directory in HOME directory. to Do not request elevated rights when creating directory in owned directory..
Andreas Bergmeier (abergmeier) edited the summary of this revision. (Show Details)

This time around try more general approach.

Wow, this has been around forever, sorry about that… LGTM, thanks will commit it.

This revision is now accepted and ready to land.Oct 9 2020, 2:46 PM