kiedtl / mouse Goto Github PK
View Code? Open in Web Editor NEW[UNMAINTAINED] A simple, cross-platform app to manage, store, and backup your configuration files.
License: GNU Affero General Public License v3.0
[UNMAINTAINED] A simple, cross-platform app to manage, store, and backup your configuration files.
License: GNU Affero General Public License v3.0
Mouse does not commit changes at some point, and as a result, Mouse crashes on `mouse backup when git-crypt refuses to unlock the repository and mouse tries to parse the encryptes json.
The output error for mouse backup:
ERROR An unhandled exception was thrown in Mouse.
ERROR Please report the following error code:
INFO Error string: exception@mouse(v1.1.4):[34~37~libexec/mouse-backup.ps1@entrypoint/cmd_exec]:[backup|]:[5.1.17134.407]:[Desktop::10.0.17134.0]::[NotSpecified: (:) [ConvertFrom-Json], ArgumentException]::[System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand]::[]::[C:\Users\*****]::[ConsoleHost]@incident[a6bd033d6ef75fca64e5bd587c272fe2202ff601]
I think this is caused when Mouse crashes and does not have time to commit changes elsewhere. I suggest adding a finally block to the main entrypoint so that is mouse crashes, it still commits any changes (if there are any) and locks the repository.
mouse only accepts full flags, e.g. --no-sync
instead of -n
.
It looks like Mouse does not pop location after executing mouse sync
:
kiedtl ~ ❯❯❯ mouse sync
Error: this repository is already locked.
From github.com:Kiedtl/my-mouse-repo
* branch master -> FETCH_HEAD
Already up to date.
Everything up-to-date
Synchronized repository with GitHub.
Error: this repository is already locked.
kiedtl ~\..\dat git: master ≢ ❯❯❯
There are too many unecessary spinners in the core functions file; we don't even use one of them. I suggest we keep only the stick spinner function.
After executing the command mouse protect unlock
, Mouse then re-locks the repository.
I think it has to do with this code in bin/mouse.ps1
, line 103:
# --snip--
}
finally {
git-crypt lock
}
}
This locks the repo after each command, even if that command unlocked the repository in purpose.
I suggest we replace that code with this:
# --snip--
}
finally {
if (!($cmd -eq "protect")) {
git-crypt lock
}
}
}
Mouse appears to only to detect when the file does not exist. I suggest that a function called test_path
be added to core.ps1
and we use that instead of the Test-Path
cmdlet.
Mouse currently does not report exceptions that occur to a central bug tracking database, it instead merely shows a generated error string to the user, which I strongly suspect never will be possible be reported.
I suggest that we utilize Sentry.io to store our error reports and then export them to GitHub Issues. Yes, Sentry DOES NOT support PowerShell, but it does support .NET Standard/Core/Framework/Whatever, so we can either:
. "C:\Users\blah\mouse\lib\ravenclient.ps1"
. "C:\Users\blah\mouse\lib\errors.ps1"
[string]$dsn = "<blah blah blah blah blah blah blah blah>"
$ravenClient = New-RavenClient -SentryDsn $dsn
try {
throw "big bad error"
} catch {
$ravenClient.CaptureException($_)
}
I received several errors.
Anyway.
I think we can just debug this class and add it to our project.
Another thing we need to think about is a better logging scheme.
For v1.2.0, we should add a --show-logs
flag to all our commands that will output detailed logging information, including the output of Git and Git-Crypt, which is currently being silenced. It will make life a lot easier for the people who test and debug this application. Even when the logging flags are not set, Mouse should still log to a file (which I think ought to be in share/logs/whateverlogsname.log
, but it could be anywhere else).
I think that the logging feature should be implemented in the same way that every other class on Mouse is implemented, by creating a file lib/logging.ps1
and implementing a function of the type function Write-Log([string]$outmachine, [string]$statuscode, [string]$text, [string]$outfile );
where the $outmachine
is the program producing the output (like Git or Mouse or Git_Crypt), where the statuscode is the statuscode, and the text is the log itself.
The log should follow the form of ::
2019-01-07T11:31:58.5634006-05:00 MOUSE UE404: The file or directory requested was not found.
I suggest that the location of the git-crypt key be specified in the config file instead of hardcoded in the code.
Until now, Mouse has gotten its current version string from the share/version.dat
file. I suggest instead that in all files, Mouse instead receives its version string from a central function in lib/core.ps1
. This can save a lot of unnecessary commiting in internal updates.
Everytime we need to bump the version number, we can simply update that central function.
On typing mouse restore .scoop
, the following exception is thrown:
At C:\Users\blah\.mouse\app\libexec\mouse-restore.ps1:126 char:1
+ }
+ ~
Unexpected token '}' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
when using the develop command, even when the current branch is master, develop command displays the following output:
fatal: not a git repository (or any of the parent directories): .git
INFO On branch develop
INFO Switching to branch master
fatal: not a git repository (or any of the parent directories): .git
and ends at the ~/.mouse
location, instead of popping at where the last location was.
When updating Mouse with the mouse update
command, the following output is observed:
kiedtl ~ ❯❯❯ mouse update
fatal: not a git repository (or any of the parent directories): .git
Updating Mouse... done
Successfully updated Mouse.
fatal: not a git repository (or any of the parent directories): .git
git-crypt: Error: 'git status' failed - is this a Git repository?
kiedtl ~ ❯❯❯
I appears that Mouse is cd
ing to the wrong location.
I suggest that the config location be changed back to $HOME/.mouse/app/share/config.json
instead of where is now, with a gitignore to prevent git from tracking the config file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.