mirror of
https://github.com/YunoHost-Apps/element_ynh.git
synced 2024-09-03 18:36:08 +02:00
Fix patch source
This commit is contained in:
parent
924859de87
commit
88e6a1492e
1 changed files with 8 additions and 6 deletions
|
@ -18,7 +18,7 @@ config_riot() {
|
||||||
|
|
||||||
install_source() {
|
install_source() {
|
||||||
ynh_setup_source $final_path/
|
ynh_setup_source $final_path/
|
||||||
|
|
||||||
# if the default homeserver is external we dont add the sso support
|
# if the default homeserver is external we dont add the sso support
|
||||||
if [[ $(yunohost domain list | grep "$default_home_server") ]]
|
if [[ $(yunohost domain list | grep "$default_home_server") ]]
|
||||||
then
|
then
|
||||||
|
@ -27,16 +27,16 @@ install_source() {
|
||||||
test -n $cert_path && cp "$cert_path" $final_path/crt.pem
|
test -n $cert_path && cp "$cert_path" $final_path/crt.pem
|
||||||
chmod 600 $final_path/crt.pem
|
chmod 600 $final_path/crt.pem
|
||||||
chown $app:root $final_path/crt.pem
|
chown $app:root $final_path/crt.pem
|
||||||
|
|
||||||
cp ../sources/get_user_token.php $final_path/
|
cp ../sources/get_user_token.php $final_path/
|
||||||
|
|
||||||
# Patch the riot bundle.js file
|
# Patch the riot bundle.js file
|
||||||
# This file is a minified javascript so it's not possible to use the standrad patch because everything is only on one line.
|
# This file is a minified javascript so it's not possible to use the standrad patch because everything is only on one line.
|
||||||
# The other problem is that some variable a renamed to be more short.
|
# The other problem is that some variable a renamed to be more short.
|
||||||
# Here this variable is named unamed_object. By the regular expression we will be able to get this name and to put in the new code.
|
# Here this variable is named unamed_object. By the regular expression we will be able to get this name and to put in the new code.
|
||||||
|
|
||||||
# To make the code more readable (for debug), we can use the tool js-beautify available here : https://github.com/beautify-web/js-beautify
|
# To make the code more readable (for debug), we can use the tool js-beautify available here : https://github.com/beautify-web/js-beautify
|
||||||
|
|
||||||
# We escape all char witch could be a problem in regular expression.
|
# We escape all char witch could be a problem in regular expression.
|
||||||
escape_string() {
|
escape_string() {
|
||||||
a=${a//'\'/'\\'}
|
a=${a//'\'/'\\'}
|
||||||
|
@ -47,10 +47,12 @@ install_source() {
|
||||||
a=${a//'}'/'\}'}
|
a=${a//'}'/'\}'}
|
||||||
a=${a//'.'/'\.'}
|
a=${a//'.'/'\.'}
|
||||||
a=${a//'*'/'\*'}
|
a=${a//'*'/'\*'}
|
||||||
|
a=${a//'^'/'\^'}
|
||||||
|
a=${a//'$'/'\$'}
|
||||||
}
|
}
|
||||||
|
|
||||||
# We get the name of the Lifecycle objet
|
# We get the name of the Lifecycle objet
|
||||||
Lifecycle_object_name=$(egrep -o "onLoggedIn:\w+\.setLoggedIn," bundle.js $final_path/bundles/*/bundle.js | egrep -o ":\w+\." | egrep -o "\w")
|
Lifecycle_object_name=$(egrep -o 'onLoggedIn:[\w\$]+\.setLoggedIn,' $final_path/bundles/*/bundle.js | egrep -o ':[\w\$]+\.' | egrep -o '[\w\$]')
|
||||||
|
|
||||||
# We get the part witch we need to patch and create a regular expression
|
# We get the part witch we need to patch and create a regular expression
|
||||||
a='case"start_login":this.setStateForNewView({view:unnamed_object.LOGIN}),this.notifyNewScreen("login");break;'
|
a='case"start_login":this.setStateForNewView({view:unnamed_object.LOGIN}),this.notifyNewScreen("login");break;'
|
||||||
|
|
Loading…
Add table
Reference in a new issue