Skip to content

Commit

Permalink
[tool] 修复未正确处理目录里的库文件。Fix library file in directories that are not ad…
Browse files Browse the repository at this point in the history
…ded.
  • Loading branch information
xuges committed Jan 10, 2024
1 parent e0510d8 commit e2708fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tool/natives-add
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ fi
TEMP_DIR="/tmp/natives-add-$$"
LIB_DIR="$2/$3"
SAVE_DIR="$TEMP_DIR/$LIB_DIR"
LIB_FILE=`basename $4`
echo "Commands:"
echo "mkdir -p $SAVE_DIR"
echo "cp $4 $SAVE_DIR"
echo "jar -uf $1 -C $TEMP_DIR $LIB_DIR/$4"
echo "jar -uf $1 -C $TEMP_DIR $LIB_DIR/$LIB_FILE"
echo "rm -rf $TEMP_DIR"
echo ""

Expand All @@ -59,6 +60,6 @@ read answer
if [[ "$answer" == "" ]] || [[ "$answer" == "y" ]] || [[ "$answer" == "Y" ]]; then
mkdir -p $SAVE_DIR
cp $4 $SAVE_DIR
jar -uf $1 -C $TEMP_DIR $LIB_DIR/$4
jar -uf $1 -C $TEMP_DIR $LIB_DIR/$LIB_FILE
rm -rf $TEMP_DIR
fi
5 changes: 3 additions & 2 deletions tool/natives-add.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ IF "%4" == "" (
SET TEMP_DIR=%TEMP%\natives-add-%random%
SET FILE_PATH=%2\%3
SET SAVE_DIR=%TEMP_DIR%\%FILE_PATH:/=\%
SET LIB_FILE=%~nx4

ECHO Commands:
ECHO MKDIR %SAVE_DIR%
ECHO COPY %4 %SAVE_DIR%\
ECHO jar -uf %1 -C %TEMP_DIR% %2/%3/%4
ECHO jar -uf %1 -C %TEMP_DIR% %2/%3/%LIB_FILE%
ECHO RMDIR /S /Q %TEMP_DIR%
ECHO.

Expand All @@ -43,7 +44,7 @@ IF "%ANSWER%" == "N" GOTO end

MKDIR %SAVE_DIR%
COPY %4 %SAVE_DIR%\
jar -uf %1 -C %TEMP_DIR% %2/%3/%4
jar -uf %1 -C %TEMP_DIR% %2/%3/%LIB_FILE%
RMDIR /S /Q %TEMP_DIR%

GOTO end
Expand Down

0 comments on commit e2708fc

Please sign in to comment.