Remove execution permission from setup-env.sh (#45641)

`setup-env.sh` is meant to be sourced, not executed directly.
By revoking execution permissions, users who accidentally execute
the script will receive an error instead of seeing no effect.

* Remove execution permission from `setup-env.sh` and friends
* Don't make output file executable in `spack commands --update-completion`

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
This commit is contained in:
Dominic Hofer 2024-08-09 22:27:07 +02:00 committed by Harmen Stoppels
parent cc47ee3984
commit 246eeb2b69
7 changed files with 0 additions and 4 deletions

View file

@ -11,7 +11,6 @@
from argparse import ArgumentParser, Namespace from argparse import ArgumentParser, Namespace
from typing import IO, Any, Callable, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Union from typing import IO, Any, Callable, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Union
import llnl.util.filesystem as fs
import llnl.util.tty as tty import llnl.util.tty as tty
from llnl.util.argparsewriter import ArgparseRstWriter, ArgparseWriter, Command from llnl.util.argparsewriter import ArgparseRstWriter, ArgparseWriter, Command
from llnl.util.tty.colify import colify from llnl.util.tty.colify import colify
@ -867,9 +866,6 @@ def _commands(parser: ArgumentParser, args: Namespace) -> None:
prepend_header(args, f) prepend_header(args, f)
formatter(args, f) formatter(args, f)
if args.update_completion:
fs.set_executable(args.update)
else: else:
prepend_header(args, sys.stdout) prepend_header(args, sys.stdout)
formatter(args, sys.stdout) formatter(args, sys.stdout)

0
share/spack/setup-env.csh Executable file → Normal file
View file

0
share/spack/setup-env.fish Executable file → Normal file
View file

0
share/spack/setup-env.sh Executable file → Normal file
View file

0
share/spack/setup-tutorial-env.sh Executable file → Normal file
View file

0
share/spack/spack-completion.bash Executable file → Normal file
View file

0
share/spack/spack-completion.fish Executable file → Normal file
View file