puppetlabs / puppetlabs/puppetlabs-bash_task_helper

EXIT trap in task is ignored

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
1
Forks
11
Avg merge
10h 40m
Merged PRs (30d)
5

Description

According to the documentation, I can call task-exit from the newly installed trap, but it is ignored

#!/bin/bash

declare PT__installdir
source "$PT__installdir/bash_task_helper/files/task_helper.sh"

TMPFILE=$(mktemp)

trap "rm -f ${TMPFILE}; task-exit" EXIT

Temporary file is left behind

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example and inspect bash_task_helper/files/task_helper.sh, especially the task-exit handling reached from the EXIT trap. Done means task-exit is honored when called from the newly installed trap and the temporary file is removed as documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.