Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check bannerImage & welcomeBannerImage - resubmit #22

Conversation

amadotejada
Copy link
Contributor

The Dialog fails to open if the banner/welcome images are not available. We use this to test the image URLs and set an alternative image if the default fails. Folks can add a second custom image as a backup.

Resubmit of: #21

@amadotejada amadotejada changed the title check bannerImage & welcomeBannerImage check bannerImage & welcomeBannerImage - resubmit Apr 8, 2023
@dan-snelson dan-snelson added enhancement New feature or request good first issue Good for newcomers labels Apr 8, 2023
@dan-snelson dan-snelson added this to the 1.10.0 milestone Apr 8, 2023
dan-snelson added a commit that referenced this pull request Apr 8, 2023
@dan-snelson dan-snelson merged commit 8e31837 into setup-your-mac:development Apr 8, 2023
@dan-snelson dan-snelson self-assigned this Apr 8, 2023
@dan-snelson
Copy link
Collaborator

Thanks big bunches, @amadotejada!

dan-snelson added a commit that referenced this pull request Apr 10, 2023
10-Apr-2023
- 🆕 **Configuration Download Estimate** (Addresses [Issue No. 7]((#7)); thanks for the idea, @DevliegereM; heavy-lifting provided by @bartreardon!)
    - Manually set `configurationDownloadEstimation` within the SYM script to `true` to enable
    - New `calculateFreeDiskSpace` function will record free space to `scriptLog` before and after SYM execution
        - Compare before and after free space values via: `grep "free" $scriptLog`
    - Populate the following variables, in Gibibits (i.e., Total File Size in Gigabytes * 7.451), for each Configuration:
        - `configurationOneSize`
        - `configurationTwoSize`
        - `configurationThreeSize`
    - Specify an arbitrary value for `correctionCoefficient` (i.e., a "fudge factor" to help estimates match reality)
        - Validate actual elapsed time with: `grep "Elapsed" $scriptLog`
- 🔥 **Breaking Change** for users of Setup Your Mac prior to `1.10.0` 🔥
    - Added `recon` validation, which **must** be used when specifying the `recon` trigger (Addresses [Issue No. 19](#19))
- Standardized formatting of `toggleJamfLaunchDaemon` function
- Limit the `loggedInUserFirstname` variable to `25` characters and capitalize its first letter (Addresses [Issue No. 20](#20); thanks @mani2care!)
- Added line break to `welcomeTitle` and `welcomeBannerText`
- Replaced some generic "Mac" instances with hardware-specific model name (thanks, @Pico!)
- Replaced `verbose` Debug Mode code with `outputLineNumberInVerboseDebugMode` function (thanks, @bartreardon!)
- Removed dependency on `dialogApp`
- Check `bannerImage` and `welcomeBannerImage` ([Pull Request No. 22](#22); thanks @amadotejada!)
dan-snelson referenced this pull request Apr 13, 2023
…uplicates — is converted to a sorted, unique, JSON-compatible 'departmentList' variable (Addresses Issue No. 23; thanks @rougegoat)

Signed-off-by: Dan K. Snelson <dan@snelson.us>
@benphilware
Copy link

with drtaru's help, found that $welcomeBannerImage check will fail if the image is local to the file system rather than hosted somewhere else.
This will fail when the image is local.
if curl --output /dev/null --silent --head --fail "$welcomeBannerImage"; then updateScriptLog "WELCOME DIALOG: welcomeBannerImage is available, using it" else updateScriptLog "WELCOME DIALOG: welcomeBannerImage is not available, using a default image" welcomeBannerImage="https://img.freepik.com/free-photo/yellow-watercolor-paper_95678-448.jpg" fi

This will succeed if the image is local.
# Check if the custom welcomeBannerImage is available, and if not, use a alternative image if [ -f "$welcomeBannerImage" ]; then updateScriptLog "WELCOME DIALOG: welcomeBannerImage is available, using it" else updateScriptLog "WELCOME DIALOG: welcomeBannerImage is not available, using a default image" welcomeBannerImage="https://img.freepik.com/free-photo/yellow-watercolor-paper_95678-448.jpg" fi

@dan-snelson
Copy link
Collaborator

Thanks, @benphilware; I'll counsel with @amadotejada on how best to proceed.

@fitzwater-rowan
Copy link

I changed line 446 to if [ curl --output /dev/null --silent --head --fail "$welcomeBannerImage" ] || [ -f "$welcomeBannerImage" ]; then to resolve this issue. This statement covers both remote and local images.

@amadotejada amadotejada deleted the get-alternate-banners-dev branch April 20, 2023 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants