From 361b9b629987aeabfee072de028cf355a8222951 Mon Sep 17 00:00:00 2001 From: Khoren Markosyan Date: Wed, 10 Aug 2022 20:10:47 +0400 Subject: [PATCH] added init script for windows --- init_win.ps1 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 init_win.ps1 diff --git a/init_win.ps1 b/init_win.ps1 new file mode 100644 index 0000000..1156746 --- /dev/null +++ b/init_win.ps1 @@ -0,0 +1,33 @@ +# Define the project name (the same as name: in the pubspec.yaml file) +Set-Variable project "flutter_zxing" + +# Define the versions to download +Set-Variable zxing_version "1.4.0" + +# Define the paths to the directories where the files will be installed +Set-Variable projectPath "../../$project" +Set-Variable zxingPath "$projectPath/ios/Classes/src/zxing" + +# Create the download directory +mkdir -p download +Set-Location download + +# Download the zxing source code and unzip it +Invoke-WebRequest -O "zxing-cpp-$zxing_version.zip" "https://github.com/nu-book/zxing-cpp/archive/refs/tags/v$zxing_version.zip" +Expand-Archive "zxing-cpp-$zxing_version.zip" + +# remove zxing from project +Remove-Item -R "$zxingPath" + +# create the zxing directory +mkdir -p "$zxingPath" + +# copy zxing +Copy-Item -R "zxing-cpp-$zxing_version/core/" "$zxingPath" + +# print success message for zxing +Write-Output "ZXing $zxing_version has been successfully installed" + +# remove the downloaded files +Set-Location .. +Remove-Item -R download \ No newline at end of file