Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

cli: Open stdin as a file when present #11184

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions atom.sh
Expand Up @@ -52,6 +52,12 @@ if [ $EXPECT_OUTPUT ]; then
export ELECTRON_ENABLE_LOGGING=1
fi

if [ ! -t 0 ]; then
TEMPFILE="$(mktemp)"
cat > "$TEMPFILE"
set "$TEMPFILE" "$@"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this going to wipe out the other command arguments?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the "$@" preserves them.

fi

if [ $OS == 'Mac' ]; then
if [ -n "$BETA_VERSION" ]; then
ATOM_APP_NAME="Atom Beta.app"
Expand Down