This repository has been archived by the owner on Jul 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from fontlet/update-new-versions
feature: Update new font versions
- Loading branch information
Showing
10 changed files
with
216 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import uninstall from "../uninstaller/darwin"; | ||
import install from "../installer/darwin"; | ||
|
||
const darwinUpdater = async (font, cb) => { | ||
// Uninstall font first | ||
uninstall(font, uninsErr => { | ||
if (uninsErr) { | ||
cb({ message: "Updating failed!", params: uninsErr }, null); | ||
return; | ||
} | ||
|
||
// Update new version | ||
install(font, insErr => { | ||
if (insErr) { | ||
cb({ message: "Updating failed!", params: insErr }, null); | ||
return; | ||
} | ||
|
||
cb(null, font); | ||
}); | ||
}); | ||
}; | ||
|
||
export default darwinUpdater; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import darwinUpdater from "./darwin"; | ||
import winUpdater from "./win"; | ||
import linuxUpdater from "./linux"; | ||
|
||
const update = { | ||
win: winUpdater, | ||
darwin: darwinUpdater, | ||
linux: linuxUpdater | ||
}; | ||
|
||
export default update; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import uninstall from "../uninstaller/linux"; | ||
import install from "../installer/linux"; | ||
|
||
const linuxUpdater = async (font, cb) => { | ||
// Uninstall font first | ||
uninstall(font, uninsErr => { | ||
if (uninsErr) { | ||
cb({ message: "Updating failed!", params: uninsErr }, null); | ||
return; | ||
} | ||
|
||
// Update new version | ||
install(font, insErr => { | ||
if (insErr) { | ||
cb({ message: "Updating failed!", params: insErr }, null); | ||
return; | ||
} | ||
|
||
cb(null, font); | ||
}); | ||
}); | ||
}; | ||
|
||
export default linuxUpdater; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import uninstall from "../uninstaller/win"; | ||
import install from "../installer/win"; | ||
|
||
const winUpdater = async (font, cb) => { | ||
// Uninstall font first | ||
uninstall(font, uninsErr => { | ||
if (uninsErr) { | ||
cb({ message: "Updating failed!", params: uninsErr }, null); | ||
return; | ||
} | ||
|
||
// Update new version | ||
install(font, insErr => { | ||
if (insErr) { | ||
cb({ message: "Updating failed!", params: insErr }, null); | ||
return; | ||
} | ||
|
||
cb(null, font); | ||
}); | ||
}); | ||
}; | ||
|
||
export default winUpdater; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters