1
1
mirror of https://github.com/primer/css.git synced 2024-12-14 23:12:03 +03:00
css/script/test-migrate
2019-02-13 15:49:05 -08:00

36 lines
1015 B
Bash
Executable File

#!/bin/bash
set -e
dir=$(mktemp -d)
cat << BEFORE > $dir/input.scss
@import 'primer-core/index.scss';
@import "primer/index.scss";
@import "primer-marketing-utilities/index.scss";
@import "primer-marketing-utilities/lib/layout.scss";
@import "../node_modules/primer-product/index.scss";
@import "primer-product";
@import "primer";
@import "primer-avatars/lib/avatar.scss";
@import "primer-navigation/lib/subnav.scss";
BEFORE
cat << AFTER > $dir/expected.scss
@import '@primer/css/core/index.scss';
@import "@primer/css/index.scss";
@import "@primer/css/marketing/utilities/index.scss";
@import "@primer/css/marketing/utilities/layout.scss";
@import "../node_modules/@primer/css/product/index.scss";
@import "@primer/css/product";
@import "@primer/css";
@import "@primer/css/avatars/avatar.scss";
@import "@primer/css/navigation/subnav.scss";
AFTER
cat $dir/input.scss | bin/primer-migrate > $dir/output.scss
diff $dir/{expected,output}.scss || (
echo "Uh-oh, there was a diff!"
exit 1
)
echo "Success!"