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

chore(atoms): Make sort.sh cross-platform #6629

Merged
merged 5 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/swc_atoms/scripts/_/sort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3

import sys
lines = sys.stdin.readlines()
lines.sort()
for line in lines:
print(line,end='')
2 changes: 1 addition & 1 deletion crates/swc_atoms/scripts/sort.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -eu

cat words.txt | awk '{$1=$1};1' | uniq | sort > words_sorted.txt
cat words.txt | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | uniq | ./scripts/_/sort.py > words_sorted.txt
mv words_sorted.txt words.txt
1 change: 0 additions & 1 deletion crates/swc_atoms/words.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

*
-moz-any
-moz-calc
Expand Down