func ReplacePlaceholders(stderr io.Writer, fs afero.Fs, baseDir string, params *models.Params) (string, error) {
	var err error
	script := params.Script
	placeholders := params.Placeholders
	for _, placeholder := range placeholders {
		var value string
		if placeholder.File != "" {
			value, err = readLineFromFile(fs, filepath.Join(baseDir, placeholder.File))
			if err != nil {
				return "", err
			}
			if value == "" {
				return "", fmt.Errorf("File for placeholder '%s' seems to be empty", placeholder.Name)
			}
		} else if placeholder.Value != "" {
			value = placeholder.Value
		} else {
			fmt.Fprintf(stderr, "WARNING: Neither File nor Value are set for placeholder '%s'", placeholder.Name)
		}
		if strings.Contains(script, placeholder.Name) {
			script = strings.Replace(script, placeholder.Name, value, -1)
		} else {
			fmt.Fprintf(stderr, "WARNINIG: Placeholder '%s' is not found in script, maybe a typo?", placeholder.Name)
		}
	}
	return script, nil
}
ReplacePlaceholders replaces placeholders in Script with Placeholders
package placeholder
import (
	"bufio"
	"fmt"
	"io"
	"path/filepath"
	"strings"
	"github.com/henry40408/concourse-ssh-resource/internal/models"
	"github.com/spf13/afero"
)