Last active
August 24, 2016 05:30
-
-
Save relekang/1423e881728dba2f83504e2ca2ce4372 to your computer and use it in GitHub Desktop.
Init script for creating libdefs files for flowtype/flow-typed. Usage example `./init-libdef.sh lodash 4.x.x`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eux | |
NAME=$1 | |
VERSION=$2 | |
FLOW_VERSION=0.25.x | |
echo $NAME@$VERSION | |
DIRECTORY=$(dirname $0)/definitions/npm/${NAME}_v$VERSION | |
mkdir -p $DIRECTORY | |
mkdir -p "$DIRECTORY/flow_>=v$FLOW_VERSION" | |
echo "declare module '$NAME' {\n\n}" > "$DIRECTORY/flow_>=v$FLOW_VERSION/${NAME}_v$VERSION.js" | |
echo "// @flow\nimport $NAME from '$NAME'" > $DIRECTORY/test_${NAME}_v$VERSION.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment