This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: dep updated * feat: adds touch and chmod commands and metadata Adds UnixFSv1.5 metadata support to mfs, including displaying it when listing dirs and statting files. Also adds `touch` and `chmod` commands to manipulate metadata in a similar way to the unix shell. * chore: update deps * chore: update deps * test: add cli tests * fix: add missing dep * fix: downgrade repo * fix: fix tests after hashOnly turned to onlyHash * test: add tests for http interface * fix: use multipart pr * chore: remove unecessary browser overrides * chore: update ipfs-utils dep * fix: fix up tests, add support for timespecs * chore: use multipart pr * fix: support optional mtimes
- Loading branch information
1 parent
f533f03
commit dc1144b
Showing
81 changed files
with
4,906 additions
and
300 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
'use strict' | ||
|
||
const { | ||
asBoolean, | ||
asOctal | ||
} = require('./utils') | ||
|
||
module.exports = { | ||
command: 'chmod [mode] [path]', | ||
|
||
describe: 'Change file modes', | ||
|
||
builder: { | ||
path: { | ||
type: 'string', | ||
describe: 'The MFS path to change the mode of' | ||
}, | ||
mode: { | ||
type: 'int', | ||
coerce: asOctal, | ||
describe: 'The mode to use' | ||
}, | ||
recursive: { | ||
alias: 'r', | ||
type: 'boolean', | ||
default: false, | ||
coerce: asBoolean, | ||
describe: 'Whether to change modes recursively' | ||
}, | ||
codec: { | ||
alias: 'c', | ||
type: 'string', | ||
default: 'dag-pb', | ||
describe: 'If intermediate directories are created, use this codec to create them (experimental)' | ||
}, | ||
'hash-alg': { | ||
alias: 'h', | ||
type: 'string', | ||
default: 'sha2-256', | ||
describe: 'Hash function to use. Will set CID version to 1 if used' | ||
}, | ||
flush: { | ||
alias: 'f', | ||
type: 'boolean', | ||
default: true, | ||
coerce: asBoolean, | ||
describe: 'Flush the changes to disk immediately' | ||
}, | ||
'shard-split-threshold': { | ||
type: 'number', | ||
default: 1000, | ||
describe: 'If a directory has more links than this, it will be transformed into a hamt-sharded-directory' | ||
} | ||
}, | ||
|
||
handler (argv) { | ||
const { | ||
path, | ||
mode, | ||
getIpfs, | ||
recursive, | ||
codec, | ||
hashAlg, | ||
flush, | ||
shardSplitThreshold | ||
} = argv | ||
|
||
argv.resolve((async () => { | ||
const ipfs = await getIpfs() | ||
|
||
return ipfs.files.chmod(path, mode, { | ||
recursive, | ||
format: codec, | ||
hashAlg, | ||
flush, | ||
shardSplitThreshold | ||
}) | ||
})()) | ||
} | ||
} |
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
Oops, something went wrong.