Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace clone to shallow clone #14

Merged
merged 2 commits into from
Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions source/2_Clone_Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { Box, Text } from 'ink';
import Spinner from 'ink-spinner';
import shell from 'shelljs';

import Configuration from './3_Configuration';
import DeleteInvalidFiles from './3_Delete_invalid_files';

const REPO_URL = 'https://github.com/hyesungoh/comet-land' as const;
const REPO_URL = 'https://github.com/hyesungoh/comet-land';

export default function CloneProject() {
const [isLoading, setIsLoading] = useState<boolean>(true);

useEffect(() => {
shell.exec(`git clone ${REPO_URL}`, { silent: true }, () => {
shell.exec(`git clone ${REPO_URL} --depth=1`, { silent: true }, () => {
setIsLoading(false);
});
}, []);
Expand All @@ -37,7 +37,7 @@ export default function CloneProject() {
✅ Clone the <Text color="blue">comet-land</Text>
</Text>

<Configuration />
<DeleteInvalidFiles />
</>
);
}
37 changes: 37 additions & 0 deletions source/3_Delete_invalid_files.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React, { useEffect, useState } from 'react';
import { Box, Text } from 'ink';
import Spinner from 'ink-spinner';
import shell from 'shelljs';

import Configuration from './4_Configuration';

export default function DeleteInvalidFiles() {
const [isLoading, setIsLoading] = useState<boolean>(true);

useEffect(() => {
shell.exec('rm -rf ./comet-land/.git', { silent: true }, () => {
setIsLoading(false);
});
}, []);

if (isLoading)
return (
<Box>
<Box marginRight={1}>
<Text color="green">
<Spinner />
</Text>
</Box>

<Text>Deleting invalid files...</Text>
</Box>
);

return (
<>
<Text>✅ Deleted invalid files</Text>

<Configuration />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs';
import { Box, Text } from 'ink';
import TextInput from 'ink-text-input';

import MoreInformation from './4_More_Information';
import MoreInformation from './5_More_Information';

const DIRNAME = process.cwd() + '/comet-land';

Expand Down
File renamed without changes.