element-web-patches/patches/delete_login_footer.sh

60 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
# This file is part of the element-web-patches.
#
# element-web-patches is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# element-web-patches is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with element-web-patches. If not, see <https://www.gnu.org/licenses/>.
echo "Deleting login footer..."
error() {
echo "Failed to patch, exiting..."
exit 1
}
patch_content=$(cat << EOF
--- a/components.json
+++ b/components.json
@@ -1,5 +1,4 @@
{
- "src/components/views/auth/AuthFooter.tsx": "src/components/views/auth/VectorAuthFooter.tsx",
"src/components/views/auth/AuthHeaderLogo.tsx": "src/components/views/auth/VectorAuthHeaderLogo.tsx",
"src/components/views/auth/AuthPage.tsx": "src/components/views/auth/VectorAuthPage.tsx"
}
--- a/src/components/views/auth/VectorAuthPage.tsx
+++ b/src/components/views/auth/VectorAuthPage.tsx
@@ -17,8 +17,6 @@
import * as React from "react";
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
-import VectorAuthFooter from "./VectorAuthFooter";
-
export default class VectorAuthPage extends React.PureComponent {
private static welcomeBackgroundUrl?: string;
@@ -77,7 +75,6 @@
{this.props.children}
</div>
</div>
- <VectorAuthFooter />
</div>
);
}
EOF
)
(cd "${1}" && echo "${patch_content}" | patch -p1) || error
rm -f "${1}"/src/components/views/auth/VectorAuthFooter.tsx \
"${1}"/test/unit-tests/components/views/auth/VectorAuthFooter-test.tsx \
"${1}"/test/unit-tests/components/views/auth/__snapshots__/VectorAuthFooter-test.tsx.snap