Merge branch 'master' of github.com:laurent22/joplin

pull/2367/head ios-v10.0.43
Laurent Cozic 2020-01-25 10:28:57 +00:00
commit 9dda65de20
7 changed files with 50 additions and 21 deletions

View File

@ -1,6 +1,6 @@
{
"name": "joplin",
"version": "1.0.150",
"version": "1.0.153",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -20,7 +20,7 @@
],
"owner": "Laurent Cozic"
},
"version": "1.0.150",
"version": "1.0.153",
"bin": {
"joplin": "./main.js"
},

View File

@ -1,4 +1,7 @@
#!/bin/bash
echo "Deprecated! Use `node Tools/release-cli.js`"
exit 1
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

View File

@ -26,7 +26,7 @@ async function gitLog(sinceTag) {
author: {
email: authorEmail,
name: authorName,
login: await githubUsername(authorEmail),
login: await githubUsername(authorEmail, authorName),
},
});
}
@ -223,7 +223,6 @@ async function findFirstRelevantTag(baseTag) {
while (true) {
try {
const logs = await gitLog(tag);
console.info(logs);process.exit();
if (logs.length) return tag;
} catch (error) {
if (error.message.indexOf('unknown revision') >= 0) {

View File

@ -74,6 +74,7 @@ async function main() {
const defaultEditor = await execCommand('echo $EDITOR');
const finalCmds = [
'git pull',
'git add -A',
`git commit -m "CLI ${newVersion}"`,
`git tag "cli-${newVersion}"`,

View File

@ -122,35 +122,43 @@ async function saveGitHubUsernameCache(cache) {
await fs.writeFile(path, JSON.stringify(cache));
}
toolUtils.githubUsername = async function(email) {
toolUtils.githubUsername = async function(email, name) {
const cache = await loadGitHubUsernameCache();
if (email in cache) return cache[email];
const cacheKey = `${email}:${name}`;
if (cacheKey in cache) return cache[cacheKey];
let output = null;
const oauthToken = await toolUtils.githubOauthToken();
const response = await fetch(`https://api.github.com/search/users?q=${encodeURI(email)}+in:email`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': `token ${oauthToken}`,
},
});
const urlsToTry = [
`https://api.github.com/search/users?q=${encodeURI(email)}+in:email`,
`https://api.github.com/search/users?q=user:${encodeURI(name)}`,
];
const responseText = await response.text();
for (const url of urlsToTry) {
const response = await fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': `token ${oauthToken}`,
},
});
const responseText = await response.text();
if (!response.ok) continue;
if (response.ok) {
const responseJson = JSON.parse(responseText);
if (!responseJson || !responseJson.items || responseJson.items.length !== 1) {
output = null;
} else {
output = responseJson.items[0].login;
}
if (!responseJson || !responseJson.items || responseJson.items.length !== 1) continue;
output = responseJson.items[0].login;
break;
}
cache[email] = output;
cache[cacheKey] = output;
await saveGitHubUsernameCache(cache);
return output;
};

View File

@ -1,5 +1,23 @@
# Joplin terminal app changelog
## [cli-v1.0.153](https://github.com/laurent22/joplin/releases/tag/cli-v1.0.153) - 2020-01-24T23:16:32Z
- New: Added new, more secure encryption methods, so that they can be switched to at a later time
- New: Add --export, --import, and --import-file flags to joplin config (#2179 by Marcus Hill)
- New: Added more logging for resource fetching to try to debug issue
- New: Add warning message when user tries to upload a file 10MB or larger (#2102) (#2097 by Marcus Hill)
- Improved: Replace note links with relative paths in MD Exporter (#2161 by Vaidotas Simkus)
- Improved: Upgrade sqlite (#2248 by Devon Zuegel)
- Improved: Extract note renderer to separate package (WIP) (#2206 by Laurent Cozic)
- Improved: Better handling of resource download errors, and added resource info to sync status screen
- Improved: Update CliClient node dependency to 10+ (#2177 by [@joeltaylor](https://github.com/joeltaylor))
- Improved: Allow exporting a note as HTML
- Improved: Improved logging during sync to allow finding bugs more easily
- Fixed: Handle WebDAV servers that do not return a last modified date (fixes mail.ru) (#2091)
- Fixed: Restaured translations that had been accidentally deleted (#2126)
- Fixed: Prevent synch from happening if target dir could not be created, in local sync (#2117)
- Fixed: Handle rare case when notebook has a parent that no longer exists, which causes a crash when sorting (#2088)
## [cli-v1.0.150](https://github.com/laurent22/joplin/releases/tag/cli-v1.0.150) - 2019-11-11T19:19:03Z
- New: Add command to list all tags for a note (#2003) (#1974)