/[sudobot]/trunk/src/commands/fun/CatCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/fun/CatCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 376 by rakin, Mon Jul 29 17:28:24 2024 UTC revision 377 by rakin, Mon Jul 29 17:29:52 2024 UTC
# Line 37  export default class CatCommand extends Line 37  export default class CatCommand extends
37                  name = name[name.length - 1];                  name = name[name.length - 1];
38    
39                  console.log(name);                  console.log(name);
40                  let filename = path.join(__dirname, '../../..', 'tmp', name);                  let filename = path.join(process.env.SUDO_PREFIX ?? path.join(__dirname, '../../..'), 'tmp', name);
41    
42                  if (filename.endsWith('.false')) {                  if (filename.endsWith('.false')) {
43                      filename = filename.replace(/\.false$/, '.png');                      filename = filename.replace(/\.false$/, '.png');

Legend:
Removed from v.376  
changed lines
  Added in v.377

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26