From ff6667f564012f5cb3bdb7773361b309dada1aba Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 6 May 2015 12:17:13 -0400 Subject: [PATCH] update embedding interfaces mod.rs generator script to add MPL also use better zsh syntax --- ports/cef/regen_interface_mod_rs.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) mode change 100644 => 100755 ports/cef/regen_interface_mod_rs.sh 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