mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-15 15:10:31 -08:00
fix: check git before get git
This commit is contained in:
parent
c9a34b8a8f
commit
2bb6831bae
3 changed files with 6 additions and 5 deletions
|
|
@ -106,7 +106,6 @@ export function useWikiWorkspaceForm() {
|
||||||
}, [mainWikiToLink]);
|
}, [mainWikiToLink]);
|
||||||
const [gitRepoUrl, gitRepoUrlSetter] = useState<string>('');
|
const [gitRepoUrl, gitRepoUrlSetter] = useState<string>('');
|
||||||
|
|
||||||
// FIXME: on dev, this will get TiddlyGit 's remote repo
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
void (async function getWorkspaceRemoteEffect(): Promise<void> {
|
void (async function getWorkspaceRemoteEffect(): Promise<void> {
|
||||||
if (existedWikiFolderPath !== undefined) {
|
if (existedWikiFolderPath !== undefined) {
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,10 @@ export class Git implements IGitService {
|
||||||
|
|
||||||
public debounceCommitAndSync: (wikiFolderPath: string, remoteUrl: string, userInfo: IGitUserInfos) => Promise<void> | undefined;
|
public debounceCommitAndSync: (wikiFolderPath: string, remoteUrl: string, userInfo: IGitUserInfos) => Promise<void> | undefined;
|
||||||
|
|
||||||
public async getWorkspacesRemote(wikiFolderPath: string): Promise<string> {
|
public async getWorkspacesRemote(wikiFolderPath: string): Promise<string | undefined> {
|
||||||
return await getRemoteUrl(wikiFolderPath);
|
if (await hasGit(wikiFolderPath)) {
|
||||||
|
return await getRemoteUrl(wikiFolderPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getModifiedFileList(wikiFolderPath: string): Promise<ModifiedFileList[]> {
|
public async getModifiedFileList(wikiFolderPath: string): Promise<ModifiedFileList[]> {
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ export interface IGitService {
|
||||||
initWikiGit(wikiFolderPath: string, isSyncedWiki: true, remoteUrl: string, userInfo: IGitUserInfos): Promise<void>;
|
initWikiGit(wikiFolderPath: string, isSyncedWiki: true, remoteUrl: string, userInfo: IGitUserInfos): Promise<void>;
|
||||||
initWikiGit(wikiFolderPath: string, isSyncedWiki?: false): Promise<void>;
|
initWikiGit(wikiFolderPath: string, isSyncedWiki?: false): Promise<void>;
|
||||||
commitAndSync(wikiFolderPath: string, remoteUrl: string, userInfo: IGitUserInfos): Promise<void>;
|
commitAndSync(wikiFolderPath: string, remoteUrl: string, userInfo: IGitUserInfos): Promise<void>;
|
||||||
/** Inspect git's remote url from folder's .git config */
|
/** Inspect git's remote url from folder's .git config, return undefined if there is no initialized git */
|
||||||
getWorkspacesRemote(wikiFolderPath: string): Promise<string>;
|
getWorkspacesRemote(wikiFolderPath: string): Promise<string | undefined>;
|
||||||
clone(remoteUrl: string, repoFolderPath: string, userInfo: IGitUserInfos): Promise<void>;
|
clone(remoteUrl: string, repoFolderPath: string, userInfo: IGitUserInfos): Promise<void>;
|
||||||
}
|
}
|
||||||
export const GitServiceIPCDescriptor = {
|
export const GitServiceIPCDescriptor = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue