diff --git a/ports/cef/regen_interface_mod_rs.sh b/ports/cef/regen_interface_mod_rs.sh old mode 100644 new mode 100755 index 57d3915d5f5..665a50957e0 --- a/ports/cef/regen_interface_mod_rs.sh +++ b/ports/cef/regen_interface_mod_rs.sh @@ -1,7 +1,19 @@ #!/bin/zsh +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +setopt extended_glob +echo -e $(cat << END_MPL +/* This Source Code Form is subject to the terms of the Mozilla Public\n + * License, v. 2.0. If a copy of the MPL was not distributed with this\n + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n +END_MPL) >>| interfaces_mod.rs + # loop all files in interfaces dir -for x in interfaces/^*mod.rs +for x in $(print interfaces/*.rs~interfaces/mod.rs) do # open the use statement echo -n "pub use interfaces::$(basename $x .rs)::{" >>| interfaces_mod.rs @@ -26,7 +38,7 @@ grep -E '^pub struct Cef' types.rs|sed 's/pub struct \([^ ]*\) .*/pub use types: # newline separators echo -e '\n\n' >>| interfaces_mod.rs # loop all files in interfaces dir again -for x in interfaces/^*mod.rs +for x in $(print interfaces/*.rs~interfaces/mod.rs) do # add mod statements for all interfaces echo "pub mod $(basename $x .rs);" >>| interfaces_mod.rs