mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-09 22:43:09 +08:00
🚧 WIP(custom): v3.0.0 migrate to vite and esm
This commit is contained in:
18
resources/wsl.sh
Normal file
18
resources/wsl.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# grab the paths
|
||||
scriptPath=$(echo $0 | awk '{ print substr( $0, 1, length($0)-6 ) }')"windows10.ps1"
|
||||
imagePath=$(echo $1 | awk '{ print substr( $0, 1, length($0)-18 ) }')
|
||||
imageName=$(echo $1 | awk '{ print substr( $0, length($0)-17, length($0) ) }')
|
||||
|
||||
# run the powershell script
|
||||
res=$(powershell.exe -noprofile -noninteractive -nologo -sta -executionpolicy unrestricted -file $(wslpath -w $scriptPath) $(wslpath -w $imagePath)"\\"$imageName)
|
||||
|
||||
# note that there is a return symbol in powershell result
|
||||
noImage=$(echo "no image\r")
|
||||
|
||||
# check whether image exists
|
||||
if [ "$res" = "$noImage" ] ;then
|
||||
echo "no image"
|
||||
else
|
||||
echo $(wslpath -u $res)
|
||||
fi
|
||||
Reference in New Issue
Block a user