Skip to content

Commit

Permalink
docs: cli tutor for cat import
Browse files Browse the repository at this point in the history
+ unifying import/export language
  • Loading branch information
lidel committed Mar 4, 2025
1 parent 9ef6095 commit b23ef89
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/locales/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"unselectAll": "Unselect all",
"generate": "Generate",
"publish": "Publish",
"downloadCar": "Download as CAR",
"downloadCar": "Export CAR",
"done": "Done"
},
"cliModal": {
Expand Down
4 changes: 4 additions & 0 deletions src/bundles/files/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export const cliCommandList = {
* @param {string} path
*/
[cliCmdKeys.FROM_IPFS]: (path) => `ipfs files cp /ipfs/<cid> "${path}/<dest-name>"`,
/**
* @param {string} path
*/
[cliCmdKeys.FROM_CAR]: (path) => `ipfs dag import file.car && ipfs files cp /ipfs/<imported-cid> "${path}/<dest-name>"`,
[cliCmdKeys.ADD_NEW_PEER]: () => 'ipfs swarm connect <peer-multiaddr>',
/**
* @param {string} ipfsPath
Expand Down
3 changes: 2 additions & 1 deletion src/files/file-input/FileInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class FileInput extends React.Component {
<DecentralizationIcon className='fill-aqua w2 mr1' />
{t('addByPath')}
</Option>
<Option onClick={this.onAddByCar} id='add-by-car' onCliTutorMode={() => this.onCliTutorMode(cliCmdKeys.FROM_CAR)}>
<Option onClick={this.onAddByCar} id='add-by-car' onCliTutorMode={() => this.onCliTutorMode(cliCmdKeys.FROM_CAR)}
isCliTutorModeEnabled={isCliTutorModeEnabled}>
<DataIcon className='fill-aqua w2 mr1' />
{t('addByCar')}
</Option>
Expand Down
1 change: 1 addition & 0 deletions src/files/modals/Modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class Modals extends React.Component {
case cliCmdKeys.ADD_DIRECTORY:
case cliCmdKeys.CREATE_NEW_DIRECTORY:
case cliCmdKeys.FROM_IPFS:
case cliCmdKeys.FROM_CAR:
return cliCommandList[action](root.substring('/files'.length))
case cliCmdKeys.DELETE_FILE_FROM_IPFS:
case cliCmdKeys.REMOVE_FILE_FROM_IPFS:
Expand Down

0 comments on commit b23ef89

Please sign in to comment.