Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
fa26571c
Commit
fa26571c
authored
Dec 08, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bundle
parent
3d65af05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
3 deletions
+65
-3
app/apps.service.ts
app/apps.service.ts
+65
-3
No files found.
app/apps.service.ts
View file @
fa26571c
...
...
@@ -61,16 +61,78 @@ export class AppsService {
}
async
migrate
()
{
await
this
.
bundle
();
await
this
.
migrate_v2_ygopro
();
await
this
.
migreate_library
();
}
async
bundle
()
{
try
{
const
bundle
=
require
(
path
.
join
(
remote
.
app
.
getPath
(
'
appData
'
),
'
mycard
'
,
'
bundle.json
'
));
// 示例:
// [
// {
// "app": "th105",
// "createShortcut": false,
// "createDesktopShortcut": false,
// "install": true,
// "installDir": "D:\\MyCardLibrary\\apps\\th105",
// "installLibrary": "D:\\MyCardLibrary"
// },
// {
// "app": "th105-lang-zh-CN",
// "createShortcut": false,
// "createDesktopShortcut": false,
// "install": true,
// "installDir": "D:\\MyCardLibrary\\apps\\th105",
// "installLibrary": "D:\\MyCardLibrary"
// },
// {
// "app": "th123",
// "createShortcut": false,
// "createDesktopShortcut": true,
// "install": true,
// "installDir": "D:\\MyCardLibrary\\apps\\th123",
// "installLibrary": "D:\\MyCardLibrary"
// },
// {
// "app": "th123-lang-zh-CN",
// "createShortcut": false,
// "createDesktopShortcut": false,
// "install": true,
// "installDir": "D:\\MyCardLibrary\\apps\\th123",
// "installLibrary": "D:\\MyCardLibrary"
// },
// {
// "app": "directx",
// "createShortcut": false,
// "createDesktopShortcut": false,
// "install": true,
// "installDir": "D:\\MyCardLibrary\\apps\\directx",
// "installLibrary": "D:\\MyCardLibrary"
// },
// ]
// {
// library: "D:\\MyCardLibrary",
// apps: ["th105", "th105-lang-zh-CN", "th123", "th123-lang-zh-CN", "directx"]
// }
// 文件在 D:\MyCardLibrary\cache\th105.tar.xz, D:\MyCardLibrary\cache\th105-lang-zh-CN.tar.xz ...
// TODO: 安装那些app,不需要下载。安装成功后删除 bundle.json
}
catch
(
error
)
{
}
}
async
migrate_v2_ygopro
()
{
// 导入萌卡 v2 的 YGOPRO
if
(
this
.
apps
.
get
(
'
ygopro
'
)
!
.
isInstalled
())
{
return
}
try
{
const
legacy_ygopro_path
=
require
(
path
.
join
(
'
db.json
'
)).
local
.
ygopro
.
path
;
const
legacy_ygopro_path
=
require
(
path
.
join
(
remote
.
app
.
getPath
(
'
appData
'
),
'
mycard
'
,
'
db.json
'
)).
local
.
ygopro
.
path
;
if
(
legacy_ygopro_path
)
{
// 导入YGOPRO
//
TODO:
导入YGOPRO
}
}
catch
(
error
)
{
...
...
@@ -135,7 +197,7 @@ export class AppsService {
// 设置App关系
for
(
let
[
id
,
app
]
of
apps
)
{
let
temp
=
app
.
actions
;
let
temp
=
app
.
actions
;
let
map
=
new
Map
<
string
,
any
>
();
for
(
let
action
of
Object
.
keys
(
temp
))
{
let
openId
=
temp
[
action
][
"
open
"
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment