Comments (16)
No można by zrobić skrypt bashowy i dodać to do crona. A jest też takie coś https://www.softfluent.com/blog/dev/Be-notified-when-a-new-release-is-created-in-a-GitHub-repository
i https://coderelease.io/
.
from polishcookieconsent.
@krystian3w A co jaki czas wg ciebie ten skrypt powinien sprawdzać, co tydzień czy szybciej?
from polishcookieconsent.
Może być co tydzień.
from polishcookieconsent.
Ok, a wykonanie skryptu PowerShell zlecam dla @krystian3w 😄. Póki co na razie jest tyle, ja tam raczej za bardzo się nie znam na windowsowych skryptach.
$URI = "https://api.github.com/repos/PolishFiltersTeam/PolishCookieConsent/releases/latest"
$NEW_VERSION_TAG = Invoke-RestMethod -Method Get -Uri $URI | select -expand tag_name
$NEW_VERSION = "$NEW_VERSION_TAG".Trim("v", " ")
$PATH_INSTALL_EXT=[Environment]::GetFolderPath("UserProfile")+"\Rozszerzenia\PolishCookieConsent"
$OLD_VERSION=cat $PATH_INSTALL_EXT\manifest.json | Select-String -Pattern '"version":'
$PATH_DOWN_EXT=[Environment]::GetFolderPath("UserProfile")+"\Downloads\PolishCookieConsent_v$NEW_VERSION"
OLD_VERSION jest niekompletne i dalej trzeba dorobić pobieranie, wypakowywanie i zrobić Task (https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtasktrigger?view=win10-ps
).
from polishcookieconsent.
@krystian3w I jak tam postępy 😄?
from polishcookieconsent.
Brak 😣.
from polishcookieconsent.
# Download latest 'PolishFiltersTeam/PolishCookieConsent' release from github
# Special thanks for @MarkTiedemann and @f3l3gy
# credits:
# https://gist.github.com/MarkTiedemann/c0adc1701f3f5c215fc2c2d5b1d5efd3
# https://gist.github.com/f3l3gy/0e89dde158dde024959e36e915abf6bd
$repo = "PolishFiltersTeam/PolishCookieConsent"
$file = "PolishCookieConsent_chromium.zip"
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$tag = (Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json)[0].tag_name
$download = "https://github.com/$repo/releases/download/$tag/$file"
$name = $file.Split(".")[0]
$zip = "$name.zip"
$dir = "$name"
Write-Host Dowloading latest release
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest $download -Out $zip
Write-Host Extracting release files
Expand-Archive $zip -Force
# Cleaning up target dir
#Remove-Item $name -Recurse -Force -ErrorAction SilentlyContinue
# Moving from temp dir to target dir
#Move-Item $dir\$name -Destination $name -Force
# Removing temp files
Remove-Item $zip -Force
#Remove-Item $dir -Recurse -Force
pause
Jeszcze muszę ogarnąć ten task i wykrywanie już dodanego cyklicznego zadania w harmonogramie.
I by działał z dowolnego folderu zamiast rozszerzenia
lub obok tego gdzie mamy dodatek (ścieżka temp i ścieżka właściwa jak podajesz w swoim przykładzie).
from polishcookieconsent.
@krystian3w Powinno być też sprawdzanie wersji, żeby podmieniał tylko jeżeli jest taka potrzeba.
from polishcookieconsent.
To jeszcze pomyśle jak to połączyć albo jak dopisać pobieranie, rozpakowywanie, czyszczenie zbędnej paczki zip.
I to dodawanie do zaplanowanych zadań - na razie mam w nim z 30 czerwonych linii o komunikacie błędu.
from polishcookieconsent.
Nie umiem porównać $NEW_VERSION
z $OLD_VERSION
, jakoś nie wychodzi mi usunięcie tekstu z stringu.
$NEW_VERSION = ' "version": "' + "$NEW_VERSION_TAG".Trim("v", " ") + '",'
if ($OLD_VERSION[0].Title -eq $NEW_VERSION[0].Title)
{Write-Host yes } else {Write-Host no }
Ale trochę badziewne
from polishcookieconsent.
[Net.ServicePointManager]::SecurityProtocol = 'TLS11','TLS12','ssl3'
$repo = "PolishFiltersTeam/PolishCookieConsent"
$releases = "https://api.github.com/repos/$repo/releases"
$NEW_VERSION = $((Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name).TRIM("v", " ")
Write-Output "$NEW_VERSION"
$PATH_DOWN_EXT = [Environment]::GetFolderPath("UserProfile")+"\Downloads\PolishCookieConsent_v$NEW_VERSION"
$PATH_INSTALL_EXT = [Environment]::GetFolderPath("UserProfile")+"\Rozszerzenia\PolishCookieConsent"
$OLD_VERSION = $(cat $PATH_INSTALL_EXT\manifest.json | Select-String -Pattern '"version":').Line.Split(':')[1] -replace '"', "" -replace ',', "" -replace '\s',''
Write-Output "$OLD_VERSION"
$zip = "PolishCookieConsent_chromium.zip"
If ( $NEW_VERSION -gt $OLD_VERSION )
{
new-item $PATH_DOWN_EXT -itemtype directory
Invoke-WebRequest "https://github.com/$repo/releases/download/v$NEW_VERSION/$zip" -OutFile $PATH_DOWN_EXT/$zip
Expand-Archive -Path $PATH_DOWN_EXT/$zip -DestinationPath $PATH_INSTALL_EXT -Force
Remove-Item $PATH_DOWN_EXT -Recurse
[System.Windows.Forms.MessageBox]::Show("Rozszerzenie Polska Ciasteczkowa Zgoda zostało zaktualizowane. Proszę zrestartować przeglądarkę.", "Sukces")
}
Else
{
[System.Windows.Forms.MessageBox]::Show("Aktualnie nie ma nowszej wersji rozszerzenia Polska Ciasteczkowa Zgoda.", "Informacja")
}
To teraz tylko task został.
from polishcookieconsent.
Aha, najpierw musiałbym taki poleceniami CMD ogarnąć i raczej będą działać w PS.
from polishcookieconsent.
@krystian3w Skrypt dla PS już gotowy, wymagany jest PS 5.1+ 😄.
from polishcookieconsent.
A jest sprawdzanie wersji i linki do Uaktualnienia PS do 5.1 na Windows 7 / 8.1?
Nie wiem jaki ma 10 może 6.0
.
from polishcookieconsent.
@krystian3w Tzn. sprawdzanie wersji PowerShella? Nie ma, napisałem tylko w readme, że 5.1+, linków do uaktualnienia też brak.
from polishcookieconsent.
https://www.microsoft.com/en-us/download/details.aspx?id=54616
from polishcookieconsent.
Related Issues (20)
- pocztapolska24.pl
- kontrowersje.net HOT 1
- interia.pl HOT 1
- wpolityce.pl HOT 1
- nczas.com HOT 3
- dobreprogramy.pl HOT 2
- vibez.pl HOT 5
- play24.pl - The requested URL was rejected HOT 5
- emuia1.gugik.gov.pl
- mapaodoru.pgkslupsk.pl HOT 3
- Prośba o dodanie przeglądarki LibreWolf HOT 1
- Zgoda ciasteczkowa - Adguard HOT 5
- click.kaufland.com
- Baza filtrów cofa czasem się do wbudowanej w ostatnią wersje HOT 4
- Plany na przyszłość HOT 15
- polsatgo.pl HOT 6
- wp.pl HOT 1
- Przyciski eksportu filtrów/domen działają źle HOT 1
- Manifest V3 HOT 2
- o2.pl HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polishcookieconsent.