Skip to content

Common location for portable bash helper functions / aliases #46020

Closed

Description

@advaitjain

@tensorflow/micro

PR #46011 fixes the use of md5sum to be compatible with a Mac. We are already using md5sum in additional places too.

While we should get #46011 merged, it would be better to have a common location for these helper functions / aliases.

I can imagine collecting these into a common helper script (for example micro/tools/bash_helpers.sh) and have something like:

UNAME_S=`uname -s`

if [ UNAME_S == Linux]; then
  alias tflm_md5sum='md5sum'
else if [ UNAME_S == Darwin ]; then
  alias tflm_md5sum='md5 -r'
fi

We would then need to change the different download scripts to determine the directory in which the script lives, something like:

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR=${SCRIPT_DIR}/../../../../..
cd "${ROOT_DIR}"

and then have

source tensorflow/lite/micro/tools/bash_helper.sh

Activity

  1. added
    comp:micro
    on Dec 28, 2020
  2. added
    comp:lite
    on Dec 29, 2020
  3. google-ml-butler commented on Jan 8, 2021

    @google-ml-butler

    Are you satisfied with the resolution of your issue?
    Yes
    No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

comp:litecomp:microtype:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions